[gnome-software] Fix up visiblity handling for header buttons



commit 30d60c80c298dacc21cc32aba606ec3f22031924
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Sep 12 22:14:34 2013 -0400

    Fix up visiblity handling for header buttons
    
    We were showing the buttons in details mode, e.g. Fix this
    by reinstating this as the responsibility of the refresh
    functions.

 src/gs-shell-updates.c |    7 +++++--
 src/gs-shell.c         |    3 ---
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index b81202a..40db160 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -96,7 +96,9 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
        }
 
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_updates"));
-       if (list != NULL && gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATES)
+       if (list != NULL &&
+            gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATES &&
+            gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATED)
                gtk_style_context_add_class (gtk_widget_get_style_context (widget), "needs-attention");
        else
                gtk_style_context_remove_class (gtk_widget_get_style_context (widget), "needs-attention");
@@ -138,7 +140,8 @@ gs_shell_updates_refresh (GsShellUpdates *shell_updates,
        GtkSpinner *spinner;
        GList *list;
 
-       if (gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_UPDATES) {
+       if (gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_UPDATES ||
+            gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_UPDATED) {
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_main"));
                gtk_widget_show (widget);
        }
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 366a7d7..ab88d38 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -128,9 +128,6 @@ gs_shell_change_mode (GsShell *shell, GsShellMode mode, GsApp *app, GsCategory *
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), mode == GS_SHELL_MODE_UPDATES);
        priv->ignore_primary_buttons = FALSE;
 
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_main"));
-       gtk_widget_set_visible (widget, mode != GS_SHELL_MODE_UPDATED);
-
        /* switch page */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "notebook_main"));
        gtk_notebook_set_current_page (GTK_NOTEBOOK (widget),


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