emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master db74a93: Fix display of tab-bar buttons


From: Eli Zaretskii
Subject: master db74a93: Fix display of tab-bar buttons
Date: Tue, 7 Sep 2021 06:25:01 -0400 (EDT)

branch: master
commit db74a93659d8a94b6f3db88ba1402ccf5edb32d3
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix display of tab-bar buttons
    
    * 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 |  8 ++++----
 src/w32term.c   | 13 ++++++++-----
 src/xterm.c     | 13 ++++++++-----
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 7f6afd7..cde9a32 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -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))
 
diff --git a/src/w32term.c b/src/w32term.c
index ad4d1a3..ebd6723 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -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
diff --git a/src/xterm.c b/src/xterm.c
index 1887c32..b478eff 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]