[gtk+/gtk-style-context] Forgotten files
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context] Forgotten files
- Date: Fri, 26 Nov 2010 01:41:02 +0000 (UTC)
commit 926b19ee739445755d462cacb2669ab4b518c2b0
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Nov 25 12:50:17 2010 -0500
Forgotten files
tests/gtkoffscreenbox.c | 31 ++++++++++++++-----------------
tests/testadjustsize.c | 14 +++++++-------
2 files changed, 21 insertions(+), 24 deletions(-)
---
diff --git a/tests/gtkoffscreenbox.c b/tests/gtkoffscreenbox.c
index 01ba8ef..0afaa0b 100644
--- a/tests/gtkoffscreenbox.c
+++ b/tests/gtkoffscreenbox.c
@@ -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),
diff --git a/tests/testadjustsize.c b/tests/testadjustsize.c
index f82b966..54f6afc 100644
--- a/tests/testadjustsize.c
+++ b/tests/testadjustsize.c
@@ -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 ("black", &color);
+ 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 ("blue", &color);
+ 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 ("red", &color);
+ gtk_widget_override_background_color (test_widget, 0, &color);
gtk_container_add (GTK_CONTAINER (inner_box), test_widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]