[gtk+] gtkwindow: Consistently set the style classes for window-frame



commit 64cf8b731ea294615d877d43ad8df406d0013d00
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Aug 27 15:35:46 2013 -0400

    gtkwindow: Consistently set the style classes for window-frame
    
    In one place, we forgot to remove the BACKGROUND style class before
    adding window-frame. Add a helper method so these are all the same.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706922

 gtk/gtkwindow.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 434b2fe..55e5088 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6193,6 +6193,13 @@ sum_borders (GtkBorder *one,
 }
 
 static void
+add_window_frame_style_class (GtkStyleContext *context)
+{
+  gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND);
+  gtk_style_context_add_class (context, "window-frame");
+}
+
+static void
 get_decoration_size (GtkWidget *widget,
                      GtkBorder *decorations)
 {
@@ -6217,8 +6224,7 @@ get_decoration_size (GtkWidget *widget,
   context = gtk_widget_get_style_context (widget);
 
   gtk_style_context_save (context);
-  gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND);
-  gtk_style_context_add_class (context, "window-frame");
+  add_window_frame_style_class (context);
 
   /* Always sum border + padding */
   gtk_style_context_get_border (context, state, decorations);
@@ -6260,7 +6266,7 @@ update_border_windows (GtkWindow *window)
 
   context = gtk_widget_get_style_context (widget);
   gtk_style_context_save (context);
-  gtk_style_context_add_class (context, "window-frame");
+  add_window_frame_style_class (context);
   gtk_style_context_get_margin (context,
                                 gtk_widget_get_state_flags (widget),
                                 &border);
@@ -9150,8 +9156,7 @@ gtk_window_draw (GtkWidget *widget,
         {
           gtk_style_context_save (context);
 
-          gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND);
-          gtk_style_context_add_class (context, "window-frame");
+          add_window_frame_style_class (context);
 
           gtk_render_background (context, cr,
                                  window_border.left, window_border.top,


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