[gedit/wip/redesign2: 21/35] Dynanically add/remove gedit-titlebar-right css style



commit 92cd840dee91b8c3bc1e26342a16076142561da1
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Fri Jan 3 10:02:46 2014 +0100

    Dynanically add/remove gedit-titlebar-right css style

 gedit/gedit-window.c  |    8 +++++++-
 gedit/gedit-window.ui |    1 -
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index c683097..0d41c59 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -2916,19 +2916,23 @@ side_panel_visibility_changed (GSettings   *settings,
                                const gchar *key,
                                GeditWindow *window)
 {
+       GtkStyleContext *context;
        gboolean visible;
 
+       context = gtk_widget_get_style_context (window->priv->headerbar);
        visible = g_settings_get_boolean (settings, key);
 
        gtk_widget_set_visible (window->priv->side_panel, visible);
 
-       /* focus the right widget */
+       /* focus the right widget and set the right styles */
        if (visible)
        {
+               gtk_style_context_add_class (context, "gedit-titlebar-right");
                gtk_widget_grab_focus (window->priv->side_panel);
        }
        else
        {
+               gtk_style_context_remove_class (context, "gedit-titlebar-right");
                gtk_widget_grab_focus (GTK_WIDGET (window->priv->multi_notebook));
        }
 }
@@ -2957,6 +2961,8 @@ setup_side_panel (GeditWindow *window)
                              image);
 }
 
+
+
 static void
 bottom_panel_visibility_changed (GSettings   *settings,
                                 const gchar *key,
diff --git a/gedit/gedit-window.ui b/gedit/gedit-window.ui
index 8336d77..0567339 100644
--- a/gedit/gedit-window.ui
+++ b/gedit/gedit-window.ui
@@ -109,7 +109,6 @@
             <property name="visible">True</property>
             <property name="show_close_button">True</property>
             <style>
-              <class name="gedit-titlebar-right"/>
               <class name="titlebar"/>
             </style>
             <child>


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