diff options
| author | Eli Zaretskii | 2021-09-07 13:24:01 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-09-07 13:24:01 +0300 |
| commit | db74a93659d8a94b6f3db88ba1402ccf5edb32d3 (patch) | |
| tree | 030d38b4b72c716f22d2c5c95e994a51bf728cfe | |
| parent | 55540a3d89862689340aa75d1370c3e8151ee934 (diff) | |
| download | emacs-db74a93659d8a94b6f3db88ba1402ccf5edb32d3.tar.gz emacs-db74a93659d8a94b6f3db88ba1402ccf5edb32d3.zip | |
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)
| -rw-r--r-- | lisp/tab-bar.el | 8 | ||||
| -rw-r--r-- | src/w32term.c | 13 | ||||
| -rw-r--r-- | src/xterm.c | 13 |
3 files changed, 20 insertions, 14 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 7f6afd7d533..cde9a32076f 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 | |||
| 161 | (add-text-properties 0 (length tab-bar-new-button) | 161 | (add-text-properties 0 (length tab-bar-new-button) |
| 162 | `(display (image :type xpm | 162 | `(display (image :type xpm |
| 163 | :file "tabs/new.xpm" | 163 | :file "tabs/new.xpm" |
| 164 | :margin (2 . 0) | 164 | :margin ,tab-bar-button-margin |
| 165 | :ascent center)) | 165 | :ascent center)) |
| 166 | tab-bar-new-button)) | 166 | tab-bar-new-button)) |
| 167 | 167 | ||
| @@ -171,7 +171,7 @@ Possible modifier keys are `control', `meta', `shift', `hyper', `super' and | |||
| 171 | (add-text-properties 0 (length tab-bar-close-button) | 171 | (add-text-properties 0 (length tab-bar-close-button) |
| 172 | `(display (image :type xpm | 172 | `(display (image :type xpm |
| 173 | :file "tabs/close.xpm" | 173 | :file "tabs/close.xpm" |
| 174 | :margin (2 . 0) | 174 | :margin ,tab-bar-button-margin |
| 175 | :ascent center)) | 175 | :ascent center)) |
| 176 | tab-bar-close-button))) | 176 | tab-bar-close-button))) |
| 177 | 177 | ||
| @@ -1597,7 +1597,7 @@ and can restore them." | |||
| 1597 | (add-text-properties 0 (length tab-bar-back-button) | 1597 | (add-text-properties 0 (length tab-bar-back-button) |
| 1598 | `(display (image :type xpm | 1598 | `(display (image :type xpm |
| 1599 | :file "tabs/left-arrow.xpm" | 1599 | :file "tabs/left-arrow.xpm" |
| 1600 | :margin (2 . 0) | 1600 | :margin ,tab-bar-button-margin |
| 1601 | :ascent center)) | 1601 | :ascent center)) |
| 1602 | tab-bar-back-button)) | 1602 | tab-bar-back-button)) |
| 1603 | (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-forward-button))) | 1603 | (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-forward-button))) |
| @@ -1605,7 +1605,7 @@ and can restore them." | |||
| 1605 | (add-text-properties 0 (length tab-bar-forward-button) | 1605 | (add-text-properties 0 (length tab-bar-forward-button) |
| 1606 | `(display (image :type xpm | 1606 | `(display (image :type xpm |
| 1607 | :file "tabs/right-arrow.xpm" | 1607 | :file "tabs/right-arrow.xpm" |
| 1608 | :margin (2 . 0) | 1608 | :margin ,tab-bar-button-margin |
| 1609 | :ascent center)) | 1609 | :ascent center)) |
| 1610 | tab-bar-forward-button)) | 1610 | tab-bar-forward-button)) |
| 1611 | 1611 | ||
diff --git a/src/w32term.c b/src/w32term.c index ad4d1a32829..ebd672361bf 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -2031,11 +2031,14 @@ w32_draw_image_relief (struct glyph_string *s) | |||
| 2031 | if (s->hl == DRAW_IMAGE_SUNKEN | 2031 | if (s->hl == DRAW_IMAGE_SUNKEN |
| 2032 | || s->hl == DRAW_IMAGE_RAISED) | 2032 | || s->hl == DRAW_IMAGE_RAISED) |
| 2033 | { | 2033 | { |
| 2034 | thick = (tab_bar_button_relief < 0 | 2034 | if (s->face->id == TAB_BAR_FACE_ID) |
| 2035 | ? DEFAULT_TAB_BAR_BUTTON_RELIEF | 2035 | thick = (tab_bar_button_relief < 0 |
| 2036 | : (tool_bar_button_relief < 0 | 2036 | ? DEFAULT_TAB_BAR_BUTTON_RELIEF |
| 2037 | ? DEFAULT_TOOL_BAR_BUTTON_RELIEF | 2037 | : min (tab_bar_button_relief, 1000000)); |
| 2038 | : min (tool_bar_button_relief, 1000000))); | 2038 | else |
| 2039 | thick = (tool_bar_button_relief < 0 | ||
| 2040 | ? DEFAULT_TOOL_BAR_BUTTON_RELIEF | ||
| 2041 | : min (tool_bar_button_relief, 1000000)); | ||
| 2039 | raised_p = s->hl == DRAW_IMAGE_RAISED; | 2042 | raised_p = s->hl == DRAW_IMAGE_RAISED; |
| 2040 | } | 2043 | } |
| 2041 | else | 2044 | else |
diff --git a/src/xterm.c b/src/xterm.c index 1887c3255d4..b478eff2906 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -3209,11 +3209,14 @@ x_draw_image_relief (struct glyph_string *s) | |||
| 3209 | if (s->hl == DRAW_IMAGE_SUNKEN | 3209 | if (s->hl == DRAW_IMAGE_SUNKEN |
| 3210 | || s->hl == DRAW_IMAGE_RAISED) | 3210 | || s->hl == DRAW_IMAGE_RAISED) |
| 3211 | { | 3211 | { |
| 3212 | thick = (tab_bar_button_relief < 0 | 3212 | if (s->face->id == TAB_BAR_FACE_ID) |
| 3213 | ? DEFAULT_TAB_BAR_BUTTON_RELIEF | 3213 | thick = (tab_bar_button_relief < 0 |
| 3214 | : (tool_bar_button_relief < 0 | 3214 | ? DEFAULT_TAB_BAR_BUTTON_RELIEF |
| 3215 | ? DEFAULT_TOOL_BAR_BUTTON_RELIEF | 3215 | : min (tab_bar_button_relief, 1000000)); |
| 3216 | : min (tool_bar_button_relief, 1000000))); | 3216 | else |
| 3217 | thick = (tool_bar_button_relief < 0 | ||
| 3218 | ? DEFAULT_TOOL_BAR_BUTTON_RELIEF | ||
| 3219 | : min (tool_bar_button_relief, 1000000)); | ||
| 3217 | raised_p = s->hl == DRAW_IMAGE_RAISED; | 3220 | raised_p = s->hl == DRAW_IMAGE_RAISED; |
| 3218 | } | 3221 | } |
| 3219 | else | 3222 | else |