aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-01-20 10:53:49 +0000
committerPo Lu2022-01-20 10:55:52 +0000
commite26071e9903e9ba2f7a761352c31e52235f75121 (patch)
treeff160a83682c567649ba64870f725533fb8e9bd8 /src
parentb929bdaeb6bcb919d4d1a5d02713cdcac3fc44d0 (diff)
downloademacs-e26071e9903e9ba2f7a761352c31e52235f75121.tar.gz
emacs-e26071e9903e9ba2f7a761352c31e52235f75121.zip
Make system tooltips display in the menu bar on Haiku
* doc/emacs/haiku.texi (Haiku Basics): Update documentation. * src/haiku_support.cc (Highlight): Apply the hack used for regular menus to the menu bar as well. * src/haikumenu.c (digest_menu_items): Set help text on menu bar if `tooltip-mode' is t and system tooltips are used. (syms_of_haikumenu): New symbol `tooltip-mode'.
Diffstat (limited to 'src')
-rw-r--r--src/haiku_support.cc10
-rw-r--r--src/haikumenu.c7
2 files changed, 12 insertions, 5 deletions
diff --git a/src/haiku_support.cc b/src/haiku_support.cc
index cd4e6e46cd2..ae2736110ec 100644
--- a/src/haiku_support.cc
+++ b/src/haiku_support.cc
@@ -1636,17 +1636,17 @@ public:
1636 { 1636 {
1637 struct haiku_menu_bar_help_event rq; 1637 struct haiku_menu_bar_help_event rq;
1638 1638
1639 if (menu_bar_id >= 0) 1639 if (help)
1640 {
1641 Menu ()->SetToolTip (highlight_p ? help : NULL);
1642 }
1643 else if (menu_bar_id >= 0)
1640 { 1644 {
1641 rq.window = wind_ptr; 1645 rq.window = wind_ptr;
1642 rq.mb_idx = highlight_p ? menu_bar_id : -1; 1646 rq.mb_idx = highlight_p ? menu_bar_id : -1;
1643 1647
1644 haiku_write (MENU_BAR_HELP_EVENT, &rq); 1648 haiku_write (MENU_BAR_HELP_EVENT, &rq);
1645 } 1649 }
1646 else if (help)
1647 {
1648 Menu ()->SetToolTip (highlight_p ? help : NULL);
1649 }
1650 1650
1651 BMenuItem::Highlight (highlight_p); 1651 BMenuItem::Highlight (highlight_p);
1652 } 1652 }
diff --git a/src/haikumenu.c b/src/haikumenu.c
index f335bdacb40..2ceb0ff3653 100644
--- a/src/haikumenu.c
+++ b/src/haikumenu.c
@@ -158,6 +158,12 @@ digest_menu_items (void *first_menu, int start, int menu_items_used,
158 !NILP (enable), !NILP (selected), 0, window, 158 !NILP (enable), !NILP (selected), 0, window,
159 !NILP (descrip) ? SSDATA (descrip) : NULL, 159 !NILP (descrip) ? SSDATA (descrip) : NULL,
160 STRINGP (help) ? SSDATA (help) : NULL); 160 STRINGP (help) ? SSDATA (help) : NULL);
161 else if (!use_system_tooltips || NILP (Fsymbol_value (Qtooltip_mode)))
162 BMenu_add_item (menu, SSDATA (item_name),
163 !NILP (def) ? (void *) (intptr_t) i : NULL,
164 !NILP (enable), !NILP (selected), 1, window,
165 !NILP (descrip) ? SSDATA (descrip) : NULL,
166 NULL);
161 else 167 else
162 BMenu_add_item (menu, SSDATA (item_name), 168 BMenu_add_item (menu, SSDATA (item_name),
163 !NILP (def) ? (void *) (intptr_t) i : NULL, 169 !NILP (def) ? (void *) (intptr_t) i : NULL,
@@ -664,6 +670,7 @@ syms_of_haikumenu (void)
664 DEFSYM (Qdebug_on_next_call, "debug-on-next-call"); 670 DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
665 DEFSYM (Qpopup_menu, "popup-menu"); 671 DEFSYM (Qpopup_menu, "popup-menu");
666 DEFSYM (Qmouse_menu_bar_map, "mouse-menu-bar-map"); 672 DEFSYM (Qmouse_menu_bar_map, "mouse-menu-bar-map");
673 DEFSYM (Qtooltip_mode, "tooltip-mode");
667 674
668 defsubr (&Smenu_or_popup_active_p); 675 defsubr (&Smenu_or_popup_active_p);
669 defsubr (&Shaiku_menu_bar_open); 676 defsubr (&Shaiku_menu_bar_open);