diff options
author | Rodrigo Pedro <rodrigoresendespedro@gmail.com> | 2021-06-25 16:12:00 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2021-07-08 12:26:21 +0200 |
commit | bf7b487eb976abe5f036005f56e74ed7a05a1598 (patch) | |
tree | 966d56e0a4796ffe4bccf45a3a7fcfe2a93c3b6a | |
parent | 04c9f6398d977b79e517d06b1c509f258ffcc327 (diff) | |
download | nautilus-bf7b487eb976abe5f036005f56e74ed7a05a1598.tar.gz |
toolbar: Prevent closing popover when "Show Hidden Files" is toggled
When the "Show Hidden Files" check button is toggled, the popover is closed,
however, when the "Show Sidebar" check button is toggled, the popover stays
opened. This is inconsistent and the popover should stay open in all cases.
This happens because of a bug in the `nautilus_toolbar_is_menu_visible`
function implementation, which is checking the visibility of the `view_button`
popover instead of the `app_menu` popover. Let's check the visibility of the
correct popover to fix this inconsistency.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1827
-rw-r--r-- | src/nautilus-toolbar.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c index 31b67bb2f..7b1fa07f2 100644 --- a/src/nautilus-toolbar.c +++ b/src/nautilus-toolbar.c @@ -91,6 +91,8 @@ struct _NautilusToolbar GtkWidget *view_toggle_button; GtkWidget *view_toggle_icon; + GtkWidget *app_menu; + GtkWidget *operations_popover; GtkWidget *operations_container; GtkWidget *operations_revealer; @@ -1230,6 +1232,7 @@ nautilus_toolbar_class_init (NautilusToolbarClass *klass) gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, view_button); gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, view_toggle_button); gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, view_toggle_icon); + gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, app_menu); gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, back_button); gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, forward_button); gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, toolbar_switcher_container); @@ -1502,13 +1505,9 @@ nautilus_toolbar_set_window_slot (NautilusToolbar *self, gboolean nautilus_toolbar_is_menu_visible (NautilusToolbar *self) { - GtkPopover *popover; - g_return_val_if_fail (NAUTILUS_IS_TOOLBAR (self), FALSE); - popover = GTK_POPOVER (gtk_menu_button_get_popover (GTK_MENU_BUTTON (self->view_button))); - - return gtk_widget_is_visible (GTK_WIDGET (popover)); + return gtk_widget_is_visible (self->app_menu); } gboolean |