[gimp/gtk3-port: 141/240] app: port GimpOverlayFrame to GtkStyleContext
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 141/240] app: port GimpOverlayFrame to GtkStyleContext
- Date: Sat, 28 Apr 2018 18:34:49 +0000 (UTC)
commit 8fdeccb074fefcc878cdbc82a14cec3fdfde1a5c
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 adfec7f..67a8e47 100644
--- a/app/widgets/gimpoverlayframe.c
+++ b/app/widgets/gimpoverlayframe.c
@@ -132,10 +132,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;
@@ -163,13 +164,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]