[gnome-software] Only show the primary menu button on top level pages



commit ebe642bb94419085e3ab1dd3eaf5cb957423dcd1
Author: Kalev Lember <klember redhat com>
Date:   Tue Sep 25 13:41:45 2018 +0200

    Only show the primary menu button on top level pages
    
    Instead of always showing the menu button, use the same logic that we
    have for showing the mode switch button box.

 src/gs-installed-page.c | 6 ++++++
 src/gs-overview-page.c  | 2 ++
 src/gs-search-page.c    | 2 ++
 src/gs-shell.c          | 2 ++
 src/gs-updates-page.c   | 2 ++
 5 files changed, 14 insertions(+)
---
diff --git a/src/gs-installed-page.c b/src/gs-installed-page.c
index 8efd3947..6c5e8ef6 100644
--- a/src/gs-installed-page.c
+++ b/src/gs-installed-page.c
@@ -329,6 +329,8 @@ gs_installed_page_switch_to (GsPage *page, gboolean scroll_up)
        set_selection_mode (self, FALSE);
        widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "buttonbox_main"));
        gtk_widget_show (widget);
+       widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "menu_button"));
+       gtk_widget_show (widget);
 
        gs_shell_update_button_select_visibility (self);
 
@@ -614,6 +616,8 @@ set_selection_mode (GsInstalledPage *self, gboolean selection_mode)
                gtk_widget_show (self->button_select);
                widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "buttonbox_main"));
                gtk_widget_hide (widget);
+               widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "menu_button"));
+               gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "header_selection_menu_button"));
                gtk_widget_show (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "header_selection_label"));
@@ -626,6 +630,8 @@ set_selection_mode (GsInstalledPage *self, gboolean selection_mode)
                gtk_widget_show (self->button_select);
                widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "buttonbox_main"));
                gtk_widget_show (widget);
+               widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "menu_button"));
+               gtk_widget_show (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "header_selection_menu_button"));
                gtk_widget_hide (widget);
        }
diff --git a/src/gs-overview-page.c b/src/gs-overview-page.c
index 40e3ddcb..088ae7ab 100644
--- a/src/gs-overview-page.c
+++ b/src/gs-overview-page.c
@@ -902,6 +902,8 @@ gs_overview_page_switch_to (GsPage *page, gboolean scroll_up)
 
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_main"));
        gtk_widget_show (widget);
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "menu_button"));
+       gtk_widget_show (widget);
 
        /* hide the expander */
        gtk_revealer_set_transition_duration (GTK_REVEALER (priv->categories_more), 0);
diff --git a/src/gs-search-page.c b/src/gs-search-page.c
index 59787e1d..11c214f1 100644
--- a/src/gs-search-page.c
+++ b/src/gs-search-page.c
@@ -358,6 +358,8 @@ gs_search_page_switch_to (GsPage *page, gboolean scroll_up)
 
        widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "buttonbox_main"));
        gtk_widget_show (widget);
+       widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "menu_button"));
+       gtk_widget_show (widget);
 
        widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "search_bar"));
        gtk_widget_show (widget);
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 8d9eaf65..0c80a27c 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -279,6 +279,8 @@ gs_shell_change_mode (GsShell *shell,
        gtk_widget_hide (widget);
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_main"));
        gtk_widget_hide (widget);
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "menu_button"));
+       gtk_widget_hide (widget);
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header_selection_menu_button"));
        gtk_widget_hide (widget);
 
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 15bbde72..c936a8f3 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -737,6 +737,8 @@ gs_updates_page_switch_to (GsPage *page,
 
        widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "buttonbox_main"));
        gtk_widget_show (widget);
+       widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "menu_button"));
+       gtk_widget_show (widget);
 
        gtk_widget_set_visible (self->button_refresh, TRUE);
 


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