[gimp/gtk3-port: 166/237] app: port GimpOverlayFrame to GtkStyleContext
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 166/237] app: port GimpOverlayFrame to GtkStyleContext
- Date: Wed, 11 May 2011 20:55:18 +0000 (UTC)
commit 1fc2d3e461db42954c220469386b7cb4dbe696f5
Author: Michael Natterer <mitch gimp org>
Date: Wed Dec 29 15:53:15 2010 +0100
app: port GimpOverlayFrame to GtkStyleContext
app/widgets/gimpoverlayframe.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/app/widgets/gimpoverlayframe.c b/app/widgets/gimpoverlayframe.c
index f53a5ff..e2c09b4 100644
--- a/app/widgets/gimpoverlayframe.c
+++ b/app/widgets/gimpoverlayframe.c
@@ -130,10 +130,11 @@ static gboolean
gimp_overlay_frame_draw (GtkWidget *widget,
cairo_t *cr)
{
- GtkStyle *style = gtk_widget_get_style (widget);
- GtkAllocation allocation;
- gboolean rgba;
- gint border_width;
+ GtkStyleContext *style = gtk_widget_get_style_context (widget);
+ GtkAllocation allocation;
+ GdkRGBA color;
+ gboolean rgba;
+ gint border_width;
rgba = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)) != NULL;
@@ -196,13 +197,19 @@ gimp_overlay_frame_draw (GtkWidget *widget,
cairo_clip_preserve (cr);
- gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
+ gtk_style_context_get_background_color (style,
+ gtk_widget_get_state_flags (widget),
+ &color);
+ gdk_cairo_set_source_rgba (cr, &color);
cairo_paint (cr);
if (border_width > 0)
{
cairo_set_line_width (cr, 2.0);
- gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
+ gtk_style_context_get_color (style,
+ gtk_widget_get_state_flags (widget),
+ &color);
+ gdk_cairo_set_source_rgba (cr, &color);
cairo_stroke (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]