[gimp/gtk3-port: 151/249] app: port setting the canvas padding color to GtkStyleContext
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 151/249] app: port setting the canvas padding color to GtkStyleContext
- Date: Mon, 21 Mar 2011 20:48:40 +0000 (UTC)
commit 223cad4fed534425cef0607aa504a896c48c4f82
Author: Michael Natterer <mitch gimp org>
Date: Sat Dec 18 23:20:52 2010 +0100
app: port setting the canvas padding color to GtkStyleContext
app/actions/view-actions.c | 11 +++++------
app/display/gimpdisplayshell-appearance.c | 8 ++------
2 files changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/app/actions/view-actions.c b/app/actions/view-actions.c
index 8dc0e48..e63e478 100644
--- a/app/actions/view-actions.c
+++ b/app/actions/view-actions.c
@@ -650,14 +650,13 @@ view_actions_update (GimpActionGroup *group,
if (shell->canvas)
{
- GtkStyle *style = gtk_widget_get_style (shell->canvas);
- GimpRGB color;
+ GtkStyleContext *style = gtk_widget_get_style_context (shell->canvas);
+ GdkRGBA color;
- gtk_widget_ensure_style (shell->canvas);
- gimp_rgb_set_gdk_color (&color, style->bg + GTK_STATE_NORMAL);
- gimp_rgb_set_alpha (&color, GIMP_OPACITY_OPAQUE);
+ gtk_style_context_get_background_color (style, 0, &color);
+ gimp_rgb_set_alpha ((GimpRGB *) &color, GIMP_OPACITY_OPAQUE);
- SET_COLOR ("view-padding-color-theme", &color);
+ SET_COLOR ("view-padding-color-theme", (GimpRGB *) &color);
}
}
diff --git a/app/display/gimpdisplayshell-appearance.c b/app/display/gimpdisplayshell-appearance.c
index 3774e42..4713e4b 100644
--- a/app/display/gimpdisplayshell-appearance.c
+++ b/app/display/gimpdisplayshell-appearance.c
@@ -467,13 +467,9 @@ gimp_display_shell_set_padding (GimpDisplayShell *shell,
case GIMP_CANVAS_PADDING_MODE_DEFAULT:
if (shell->canvas)
{
- GtkStyle *style;
+ GtkStyleContext *style = gtk_widget_get_style_context (shell->canvas);
- gtk_widget_ensure_style (shell->canvas);
-
- style = gtk_widget_get_style (shell->canvas);
-
- gimp_rgb_set_gdk_color (&color, style->bg + GTK_STATE_NORMAL);
+ gtk_style_context_get_background_color (style, 0, (GdkRGBA *) &color);
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]