From 23b99dfab6a701be93b826e36a50b761f3d8b067 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 9 Mar 2006 16:06:32 +0000 Subject: [PATCH] show tooltps from the global image popup menu too. 2006-03-09 Michael Natterer * app/gui/gui.c: show tooltps from the global image popup menu too. --- ChangeLog | 4 ++++ app/gui/gui.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2d54d00ce6..dc61354ace 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-03-09 Michael Natterer + + * app/gui/gui.c: show tooltps from the global image popup menu too. + 2006-03-09 Michael Natterer * app/widgets/gimpuimanager.[ch]: added "show-tooltip" and diff --git a/app/gui/gui.c b/app/gui/gui.c index bb9317e9d9..4bf797b51a 100644 --- a/app/gui/gui.c +++ b/app/gui/gui.c @@ -42,6 +42,7 @@ #include "display/gimpdisplay-foreach.h" #include "display/gimpdisplayshell.h" #include "display/gimpdisplayshell-render.h" +#include "display/gimpstatusbar.h" #include "tools/gimp-tools.h" @@ -111,6 +112,12 @@ static void gui_device_change_notify (Gimp *gimp); static void gui_global_buffer_changed (Gimp *gimp); +static void gui_menu_show_tooltip (GimpUIManager *manager, + const gchar *tooltip, + Gimp *gimp); +static void gui_menu_hide_tooltip (GimpUIManager *manager, + Gimp *gimp); + static void gui_display_changed (GimpContext *context, GimpDisplay *display, Gimp *gimp); @@ -437,6 +444,12 @@ gui_restore_after_callback (Gimp *gimp, g_signal_connect_object (gui_config, "notify::tearoff-menus", G_CALLBACK (gui_tearoff_menus_notify), image_ui_manager, 0); + g_signal_connect (image_ui_manager, "show-tooltip", + G_CALLBACK (gui_menu_show_tooltip), + gimp); + g_signal_connect (image_ui_manager, "hide-tooltip", + G_CALLBACK (gui_menu_hide_tooltip), + gimp); gimp_devices_restore (gimp); gimp_controllers_restore (gimp, image_ui_manager); @@ -589,6 +602,38 @@ gui_global_buffer_changed (Gimp *gimp) gimp_clipboard_set_buffer (gimp, gimp->global_buffer); } +static void +gui_menu_show_tooltip (GimpUIManager *manager, + const gchar *tooltip, + Gimp *gimp) +{ + GimpContext *context = gimp_get_user_context (gimp); + GimpDisplay *display = gimp_context_get_display (context); + + if (display) + { + GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell); + + gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar), "menu-tooltip", + tooltip); + } +} + +static void +gui_menu_hide_tooltip (GimpUIManager *manager, + Gimp *gimp) +{ + GimpContext *context = gimp_get_user_context (gimp); + GimpDisplay *display = gimp_context_get_display (context); + + if (display) + { + GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell); + + gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "menu-tooltip"); + } +} + static void gui_display_changed (GimpContext *context, GimpDisplay *display,