This is an automated email from the git hooks/post-receive script. a n d r z e j r p u s h e d a c o m m i t t o b r a n c h m a s t e r in repository panel-plugins/xfce4-indicator-plugin.
commit f01133757140d6ca42d3dff37394e19260897230 Author: Viktor Odintsev <[email protected]> Date: Sat Jun 17 02:18:59 2017 +0300 Bug 12417: Display tooltip for indicators --- panel-plugin/indicator-button.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c index aa89c41..ce5f6e7 100644 --- a/panel-plugin/indicator-button.c +++ b/panel-plugin/indicator-button.c @@ -51,6 +51,12 @@ static gboolean xfce_indicator_button_scroll_event (GtkWidget GdkEventScroll *event); static void xfce_indicator_button_menu_deactivate (XfceIndicatorButton *button, GtkMenu *menu); +static gboolean xfce_indicator_button_query_tooltip (GtkWidget *widget, + gint x, + gint y, + gboolean keyboard_mode, + GtkTooltip *tooltip, + gpointer user_data); struct _XfceIndicatorButton @@ -276,6 +282,10 @@ xfce_indicator_button_new (IndicatorObject *io, gtk_container_add (GTK_CONTAINER (button->align_box), button->box); gtk_widget_show (button->box); + g_object_set (G_OBJECT (button), "has-tooltip", TRUE, NULL); + g_signal_connect (button, "query-tooltip", + G_CALLBACK (xfce_indicator_button_query_tooltip), NULL); + return GTK_WIDGET (button); } @@ -362,3 +372,24 @@ xfce_indicator_button_menu_deactivate (XfceIndicatorButton *button, } gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE); } + + +static gboolean +xfce_indicator_button_query_tooltip (GtkWidget *widget, + gint x, + gint y, + gboolean keyboard_mode, + GtkTooltip *tooltip, + gpointer user_data) +{ + XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (widget); + + if (button->entry && button->entry->accessible_desc) + { + gtk_tooltip_set_text (tooltip, button->entry->accessible_desc); + + return TRUE; + } + + return FALSE; +} -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce4-commits
