[gnome-software/gnome-3-24] gs-shell: use headerbar in toolbar-mode in Unity



commit 31efff1bffbe765dc82c0037bf5d30f97a7a369e
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Mon May 8 01:12:13 2017 -0700

    gs-shell: use headerbar in toolbar-mode in Unity
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782317

 src/gs-shell.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index a45e5a8..7819c6e 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -1617,6 +1617,7 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
 {
        GsShellPrivate *priv = gs_shell_get_instance_private (shell);
        GtkWidget *widget;
+       GtkStyleContext *style_context;
        GsPage *page;
 
        g_return_if_fail (GS_IS_SHELL (shell));
@@ -1644,6 +1645,9 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
        /* fix up the header bar */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header"));
        if (gs_utils_is_current_desktop ("Unity")) {
+               style_context = gtk_widget_get_style_context (widget);
+               gtk_style_context_remove_class (style_context, GTK_STYLE_CLASS_TITLEBAR);
+               gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
                gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (widget), "");
        } else {
                g_object_ref (widget);


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