]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix display of tab-bar buttons
authorEli Zaretskii <eliz@gnu.org>
Tue, 7 Sep 2021 10:24:01 +0000 (13:24 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 7 Sep 2021 10:24:01 +0000 (13:24 +0300)
* src/xterm.c (x_draw_image_relief):
* src/w32term.c (w32_draw_image_relief): Fix calculation of relief
thickness for tab-bar buttons.

* lisp/tab-bar.el (tab-bar--load-buttons)
(tab-bar-history-mode): Fix the :margin specification for tab-bar
buttons.  (Bug#50424)

lisp/tab-bar.el
src/w32term.c
src/xterm.c

index 7f6afd7d533d38f9193d3a4baa19c3ad0345561e..cde9a32076fc12396dbe348fd453814d112a7694 100644 (file)
@@ -161,7 +161,7 @@ Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
     (add-text-properties 0 (length tab-bar-new-button)
                          `(display (image :type xpm
                                           :file "tabs/new.xpm"
-                                          :margin (2 . 0)
+                                          :margin ,tab-bar-button-margin
                                           :ascent center))
                          tab-bar-new-button))
 
@@ -171,7 +171,7 @@ Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
     (add-text-properties 0 (length tab-bar-close-button)
                          `(display (image :type xpm
                                           :file "tabs/close.xpm"
-                                          :margin (2 . 0)
+                                          :margin ,tab-bar-button-margin
                                           :ascent center))
                          tab-bar-close-button)))
 
@@ -1597,7 +1597,7 @@ and can restore them."
           (add-text-properties 0 (length tab-bar-back-button)
                                `(display (image :type xpm
                                                 :file "tabs/left-arrow.xpm"
-                                                :margin (2 . 0)
+                                                :margin ,tab-bar-button-margin
                                                 :ascent center))
                                tab-bar-back-button))
         (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-forward-button)))
@@ -1605,7 +1605,7 @@ and can restore them."
           (add-text-properties 0 (length tab-bar-forward-button)
                                `(display (image :type xpm
                                                 :file "tabs/right-arrow.xpm"
-                                                :margin (2 . 0)
+                                                :margin ,tab-bar-button-margin
                                                 :ascent center))
                                tab-bar-forward-button))
 
index ad4d1a32829a0c7c1faf3bfa7d2074e244497134..ebd672361bfbba29619a5d0cfd729c5391eb5b45 100644 (file)
@@ -2031,11 +2031,14 @@ w32_draw_image_relief (struct glyph_string *s)
   if (s->hl == DRAW_IMAGE_SUNKEN
       || s->hl == DRAW_IMAGE_RAISED)
     {
-      thick = (tab_bar_button_relief < 0
-              ? DEFAULT_TAB_BAR_BUTTON_RELIEF
-              : (tool_bar_button_relief < 0
-                 ? DEFAULT_TOOL_BAR_BUTTON_RELIEF
-                 : min (tool_bar_button_relief, 1000000)));
+      if (s->face->id == TAB_BAR_FACE_ID)
+       thick = (tab_bar_button_relief < 0
+                ? DEFAULT_TAB_BAR_BUTTON_RELIEF
+                : min (tab_bar_button_relief, 1000000));
+      else
+       thick = (tool_bar_button_relief < 0
+                ? DEFAULT_TOOL_BAR_BUTTON_RELIEF
+                : min (tool_bar_button_relief, 1000000));
       raised_p = s->hl == DRAW_IMAGE_RAISED;
     }
   else
index 1887c3255d4c3d601816de44b493734dc8ead042..b478eff2906a489581b7aafc826d4fa451779497 100644 (file)
@@ -3209,11 +3209,14 @@ x_draw_image_relief (struct glyph_string *s)
   if (s->hl == DRAW_IMAGE_SUNKEN
       || s->hl == DRAW_IMAGE_RAISED)
     {
-      thick = (tab_bar_button_relief < 0
-              ? DEFAULT_TAB_BAR_BUTTON_RELIEF
-              : (tool_bar_button_relief < 0
-                 ? DEFAULT_TOOL_BAR_BUTTON_RELIEF
-                 : min (tool_bar_button_relief, 1000000)));
+      if (s->face->id == TAB_BAR_FACE_ID)
+       thick = (tab_bar_button_relief < 0
+                ? DEFAULT_TAB_BAR_BUTTON_RELIEF
+                : min (tab_bar_button_relief, 1000000));
+      else
+       thick = (tool_bar_button_relief < 0
+                ? DEFAULT_TOOL_BAR_BUTTON_RELIEF
+                : min (tool_bar_button_relief, 1000000));
       raised_p = s->hl == DRAW_IMAGE_RAISED;
     }
   else