]> Pileus Git - ~andy/gtk/commitdiff
Forgotten files
authorMatthias Clasen <mclasen@redhat.com>
Thu, 25 Nov 2010 17:50:17 +0000 (12:50 -0500)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:39:46 +0000 (15:39 +0100)
tests/gtkoffscreenbox.c
tests/testadjustsize.c

index 01ba8ef30dba842dde6f2054a43c6208d17eb48b..0afaa0b84d55414a8eea9d559361eb1571ee9a75 100644 (file)
@@ -252,7 +252,7 @@ gtk_offscreen_box_realize (GtkWidget *widget)
 {
   GtkOffscreenBox *offscreen_box = GTK_OFFSCREEN_BOX (widget);
   GtkAllocation allocation, child_area;
-  GtkStyle *style;
+  GtkStyleContext *context;
   GdkWindow *window;
   GdkWindowAttr attributes;
   gint attributes_mask;
@@ -346,10 +346,10 @@ gtk_offscreen_box_realize (GtkWidget *widget)
                    G_CALLBACK (offscreen_window_from_parent2), offscreen_box);
 
   gtk_widget_style_attach (widget);
-  style = gtk_widget_get_style (widget);
-  gtk_style_set_background (style, window, GTK_STATE_NORMAL);
-  gtk_style_set_background (style, offscreen_box->offscreen_window1, GTK_STATE_NORMAL);
-  gtk_style_set_background (style, offscreen_box->offscreen_window2, GTK_STATE_NORMAL);
+  context = gtk_widget_get_style_context (widget);
+  gtk_style_context_set_background (context, window);
+  gtk_style_context_set_background (context, offscreen_box->offscreen_window1);
+  gtk_style_context_set_background (context, offscreen_box->offscreen_window2);
 
   gdk_window_show (offscreen_box->offscreen_window1);
   gdk_window_show (offscreen_box->offscreen_window2);
@@ -672,12 +672,11 @@ gtk_offscreen_box_draw (GtkWidget *widget,
     }
   else if (gtk_cairo_should_draw_window (cr, offscreen_box->offscreen_window1))
     {
-      gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
-                          GTK_STATE_NORMAL, GTK_SHADOW_NONE,
-                          widget, "blah",
-                          0, 0,
-                          gdk_window_get_width (offscreen_box->offscreen_window1),
-                          gdk_window_get_height (offscreen_box->offscreen_window1));
+      gtk_render_background (gtk_widget_get_style_context (widget), cr,
+                             0, 0,
+
+                             gdk_window_get_width (offscreen_box->offscreen_window1),
+                             gdk_window_get_height (offscreen_box->offscreen_window1));
 
       if (offscreen_box->child1)
         gtk_container_propagate_draw (GTK_CONTAINER (widget),
@@ -686,12 +685,10 @@ gtk_offscreen_box_draw (GtkWidget *widget,
     }
   else if (gtk_cairo_should_draw_window (cr, offscreen_box->offscreen_window2))
     {
-      gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
-                          GTK_STATE_NORMAL, GTK_SHADOW_NONE,
-                          widget, "blah",
-                          0, 0,
-                          gdk_window_get_width (offscreen_box->offscreen_window2),
-                          gdk_window_get_height (offscreen_box->offscreen_window2));
+      gtk_render_background (gtk_widget_get_style_context (widget), cr,
+                             0, 0,
+                             gdk_window_get_width (offscreen_box->offscreen_window2),
+                             gdk_window_get_height (offscreen_box->offscreen_window2));
 
       if (offscreen_box->child2)
         gtk_container_propagate_draw (GTK_CONTAINER (widget),
index f82b96626614105272e86cf9d9842efa28ed1fd0..c45522ad33eeb8762ed25d95684e86df09421995 100644 (file)
@@ -236,23 +236,23 @@ create_widget_visible_border (const char *text)
   GtkWidget *inner_box;
   GtkWidget *test_widget;
   GtkWidget *label;
-  GdkColor color;
+  GdkRGBA color;
 
   outer_box = gtk_event_box_new ();
-  gdk_color_parse ("black", &color);
-  gtk_widget_modify_bg (outer_box, GTK_STATE_NORMAL, &color);
+  gdk_rgba_parse (&color, "black");
+  gtk_widget_override_background_color (outer_box, 0, &color);
 
   inner_box = gtk_event_box_new ();
   gtk_container_set_border_width (GTK_CONTAINER (inner_box), 5);
-  gdk_color_parse ("blue", &color);
-  gtk_widget_modify_bg (inner_box, GTK_STATE_NORMAL, &color);
+  gdk_rgba_parse (&color, "blue");
+  gtk_widget_override_background_color (inner_box, 0, &color);
 
   gtk_container_add (GTK_CONTAINER (outer_box), inner_box);
 
 
   test_widget = gtk_event_box_new ();
-  gdk_color_parse ("red", &color);
-  gtk_widget_modify_bg (test_widget, GTK_STATE_NORMAL, &color);
+  gdk_rgba_parse (&color, "red");
+  gtk_widget_override_background_color (test_widget, 0, &color);
 
   gtk_container_add (GTK_CONTAINER (inner_box), test_widget);