[epiphany] action-bar-end: Don't toggle bookmarks or downloads menu button if not shown



commit 0431815b641afb5d7105c8cf49c9863d9598da9c
Author: vanadiae <vanadiae35 gmail com>
Date:   Mon Jul 26 16:25:22 2021 +0200

    action-bar-end: Don't toggle bookmarks or downloads menu button if not shown
    
    Currently if no downloads were made, using the Ctrl+Shift+Y shortcut shows
    an unexpected empty popover. This does not happen in desktop mode for the
    bookmarks popover because we don't hide it here.
    
    So this commit makes those two buttons not get toggled when they are not actually
    visible, to avoid seeing a popover coming out of nowhere (in mobile mode too).
    This does not actually fix showing the popovers coming from the bottom bar in
    mobile mode, but then it that you'd generally use a touchscreen without Ctrl
    keys, so for the time being it's not a big deal though it could be fixed.
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/990>

 src/ephy-action-bar-end.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-action-bar-end.c b/src/ephy-action-bar-end.c
index ef118565c..0104fb336 100644
--- a/src/ephy-action-bar-end.c
+++ b/src/ephy-action-bar-end.c
@@ -340,13 +340,15 @@ ephy_action_bar_end_set_show_bookmarks_button (EphyActionBarEnd *action_bar_end,
 void
 ephy_action_bar_end_show_downloads (EphyActionBarEnd *action_bar_end)
 {
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (action_bar_end->downloads_button), TRUE);
+  if (gtk_widget_get_visible (action_bar_end->downloads_button))
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (action_bar_end->downloads_button), TRUE);
 }
 
 void
 ephy_action_bar_end_show_bookmarks (EphyActionBarEnd *action_bar_end)
 {
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (action_bar_end->bookmarks_button), TRUE);
+  if (gtk_widget_get_visible (action_bar_end->bookmarks_button))
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (action_bar_end->bookmarks_button), TRUE);
 }
 
 GtkWidget *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]