summaryrefslogtreecommitdiff
path: root/src/w32term.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2021-04-13 16:40:42 +0300
committerEli Zaretskii <eliz@gnu.org>2021-04-13 16:40:42 +0300
commit1667253fec963e2ffb2bb36db67564533cf92787 (patch)
treea110b3de13e980b687259875e9ef253462fcdc01 /src/w32term.c
parent6de79542e43ece9a12ebc032c275a6c3fee0b73b (diff)
downloademacs-1667253fec963e2ffb2bb36db67564533cf92787.tar.gz
emacs-1667253fec963e2ffb2bb36db67564533cf92787.tar.bz2
emacs-1667253fec963e2ffb2bb36db67564533cf92787.zip
Resurrect mouse-highlight of close buttons on tab-bar
* src/w32term.c (w32_draw_image_relief): Support tab-bar drawing with relief as xterm.c does. * src/xdisp.c (handle_tab_bar_click): Access the mouse-highlight info. Call show_mouse_face to show the button in the pressed or the released state, according to value of DOWN_P. (note_tab_bar_highlight): Function added back. (note_mouse_highlight): Call note_tab_bar_highlight when the mouse pointer is in the tab-bar window. (show_mouse_face): Return immediately if mouse_face_window is not set up in HLINFO. This avoids rare assertion violations.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 0ee805a8526..361cf33c024 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -2031,8 +2031,11 @@ w32_draw_image_relief (struct glyph_string *s)
if (s->hl == DRAW_IMAGE_SUNKEN
|| s->hl == DRAW_IMAGE_RAISED)
{
- thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief
- : DEFAULT_TOOL_BAR_BUTTON_RELIEF;
+ 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)));
raised_p = s->hl == DRAW_IMAGE_RAISED;
}
else
@@ -2045,6 +2048,19 @@ w32_draw_image_relief (struct glyph_string *s)
y1 = y + s->slice.height - 1;
extra_x = extra_y = 0;
+ if (s->face->id == TAB_BAR_FACE_ID)
+ {
+ if (CONSP (Vtab_bar_button_margin)
+ && FIXNUMP (XCAR (Vtab_bar_button_margin))
+ && FIXNUMP (XCDR (Vtab_bar_button_margin)))
+ {
+ extra_x = XFIXNUM (XCAR (Vtab_bar_button_margin));
+ extra_y = XFIXNUM (XCDR (Vtab_bar_button_margin));
+ }
+ else if (FIXNUMP (Vtab_bar_button_margin))
+ extra_x = extra_y = XFIXNUM (Vtab_bar_button_margin);
+ }
+
if (s->face->id == TOOL_BAR_FACE_ID)
{
if (CONSP (Vtool_bar_button_margin)