[gtk/wip/baedert/for-master: 20/34] modelbutton: Un-select on mouse leave
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 20/34] modelbutton: Un-select on mouse leave
- Date: Thu, 20 Feb 2020 09:24:27 +0000 (UTC)
commit ec6d5839bd7a091b7056b81138943e426c15a7bb
Author: Timm Bäder <mail baedert org>
Date: Tue Feb 18 10:02:38 2020 +0100
modelbutton: Un-select on mouse leave
This brings us closer to the old GtkMenuItem behavior and also makes
more sense.
gtk/gtkmodelbutton.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index aea36907dd..5545ed95df 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -1348,7 +1348,14 @@ leave_cb (GtkEventController *controller,
GdkNotifyType type,
gpointer data)
{
+ GtkPopoverMenu *popover;
+
+ popover = (GtkPopoverMenu*)gtk_widget_get_ancestor (GTK_WIDGET (data), GTK_TYPE_POPOVER_MENU);
+
stop_open (GTK_MODEL_BUTTON (data));
+
+ if (popover)
+ gtk_popover_menu_set_active_item (popover, NULL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]