[epiphany/gtk-style-context] Make build with GtkStyleContext
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gtk-style-context] Make build with GtkStyleContext
- Date: Tue, 16 Nov 2010 05:28:33 +0000 (UTC)
commit fb401a45127d122d980edf7e78b500ed0e3bf782
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Nov 16 00:27:37 2010 -0500
Make build with GtkStyleContext
Replace gtk_paint_ calls by gtk_render_.
embed/ephy-web-view.c | 37 ++++++++++++++++++++-----------------
1 files changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index e1d25e2..f10a3d7 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1152,7 +1152,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;
@@ -1167,8 +1167,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;
@@ -1176,20 +1174,25 @@ _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_restore (context);
+
+ gtk_render_layout (context, cr,
+ priv->text_rectangle.x + statusbar_border_width,
+ priv->text_rectangle.y + statusbar_border_width,
+ layout);
g_object_unref (layout);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]