From 43a776e85d1fd602ef28756da4a5cc6e4fed40f9 Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Tue, 16 Nov 2010 00:27:37 -0500 Subject: Port to gtk+ master's GtkStyleContext Updates all our uses of GtkStyle stuff to the newer GtkStyleContext API. ephy-web-view porting done by Matthias Clasen Bug #636501 --- embed/ephy-web-view.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'embed') diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 44ac2b887..af7e77132 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1162,7 +1162,7 @@ _ephy_web_view_draw_statusbar (GtkWidget *widget, cairo_t *cr) guint border_width, statusbar_border_width; PangoLayout *layout; GtkAllocation allocation; - GtkStyle *style; + GtkStyleContext *context; EphyWebViewPrivate *priv; priv = EPHY_WEB_VIEW (widget)->priv; @@ -1177,8 +1177,6 @@ _ephy_web_view_draw_statusbar (GtkWidget *widget, cairo_t *cr) border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - style = gtk_widget_get_style (widget); - statusbar_border_width = 4; /* FIXME: what should we use here? */ priv->text_rectangle.x = border_width; @@ -1186,20 +1184,28 @@ _ephy_web_view_draw_statusbar (GtkWidget *widget, cairo_t *cr) priv->text_rectangle.width = width + (statusbar_border_width * 2); priv->text_rectangle.height = height + (statusbar_border_width * 2); - gtk_paint_box (style, cr, - GTK_STATE_NORMAL, GTK_SHADOW_IN, - widget, NULL, - priv->text_rectangle.x, - priv->text_rectangle.y, - priv->text_rectangle.width, - priv->text_rectangle.height); - - gtk_paint_layout (style, cr, - GTK_STATE_NORMAL, FALSE, - widget, NULL, - priv->text_rectangle.x + statusbar_border_width, - priv->text_rectangle.y + statusbar_border_width, - layout); + context = gtk_widget_get_style_context (widget); + gtk_style_context_save (context); + + gtk_style_context_set_state (context, GTK_STATE_FLAG_ACTIVE); + gtk_render_background (context, cr, + priv->text_rectangle.x, + priv->text_rectangle.y, + priv->text_rectangle.width, + priv->text_rectangle.height); + gtk_render_frame (context, cr, + priv->text_rectangle.x, + priv->text_rectangle.y, + priv->text_rectangle.width, + priv->text_rectangle.height); + + gtk_style_context_set_state (context, 0); + gtk_render_layout (context, cr, + priv->text_rectangle.x + statusbar_border_width, + priv->text_rectangle.y + statusbar_border_width, + layout); + + gtk_style_context_restore (context); g_object_unref (layout); } -- cgit v1.2.3