diff options
author | Robert Roth <robert.roth.off@gmail.com> | 2018-08-24 12:55:36 +0300 |
---|---|---|
committer | Robert Roth <robert.roth.off@gmail.com> | 2018-08-24 12:55:36 +0300 |
commit | c84574724d736f2cd019c7d534200d36be9ee1f4 (patch) | |
tree | d94e5e0b7c4ca2a47059a0ab9527c97e1b7128be | |
parent | 9e0f43e8cba45015487c692058c002f56087b9b8 (diff) | |
download | gtk+-robertroth/menubutton-tooltip.tar.gz |
menubutton: don't show tooltip if menu is openrobertroth/menubutton-tooltip
Don't show tooltip for active menubuttons, as it might obstruct the
menu items.
When the menu is open (the menubutton is active), set the has-tooltip
gtk-widget property to false, to not show the tooltip.
https://gitlab.gnome.org/GNOME/gtk/issues/1234
-rw-r--r-- | gtk/gtkmenubutton.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c index 1d1a159cb3..699eb7bf55 100644 --- a/gtk/gtkmenubutton.c +++ b/gtk/gtkmenubutton.c @@ -408,6 +408,8 @@ gtk_menu_button_toggled (GtkToggleButton *button) GtkMenuButtonPrivate *priv = gtk_menu_button_get_instance_private (menu_button); gboolean active = gtk_toggle_button_get_active (button); + gtk_widget_set_has_tooltip (GTK_WIDGET (button), !active); + if (priv->menu) { if (active && !gtk_widget_get_visible (priv->menu)) |