summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-11-03 15:19:14 +0300
committerMonsta <[email protected]>2015-12-07 14:18:50 +0300
commit6d759e6e81f04059bf17f723a57d58407a5b20e2 (patch)
treec6d82219bcf753bd429440f2cebc6f5d12e1a46f
parentc9ba0f22249e1c65b4b2a76c3a752b174355cfd0 (diff)
downloadmate-applets-6d759e6e81f04059bf17f723a57d58407a5b20e2.tar.bz2
mate-applets-6d759e6e81f04059bf17f723a57d58407a5b20e2.tar.xz
stickynotes: correctly apply chosen font color in GTK+3 build
adapted from https://git.gnome.org/browse/gnome-applets/commit/?id=107534eb0cc2ebb45622295b7e9a1a0280e32e0e
-rw-r--r--stickynotes/stickynotes.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index 5511fd30..dbdd1499 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -555,18 +555,17 @@ stickynote_set_color (StickyNote *note,
if (font_color_str_actual)
{
- GdkColor font_color;
-
#if GTK_CHECK_VERSION (3, 0, 0)
GdkRGBA color;
gdk_rgba_parse (&color, font_color_str_actual);
- font_color.red = color.red;
- font_color.green = color.green;
- font_color.blue = color.blue;
+
+ gtk_widget_override_color (note->w_window, GTK_STATE_NORMAL, &color);
+ gtk_widget_override_color (note->w_body, GTK_STATE_NORMAL, &color);
#else
+ GdkColor font_color;
+
gdk_color_parse (font_color_str_actual, &font_color);
-#endif
gtk_widget_modify_text (note->w_window,
GTK_STATE_NORMAL, &font_color);
@@ -576,9 +575,14 @@ stickynote_set_color (StickyNote *note,
GTK_STATE_NORMAL, &font_color);
gtk_widget_modify_text (note->w_body,
GTK_STATE_PRELIGHT, &font_color);
+#endif
}
else
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_override_color (note->w_window, GTK_STATE_NORMAL, NULL);
+ gtk_widget_override_color (note->w_body, GTK_STATE_NORMAL, NULL);
+#else
gtk_widget_modify_text (note->w_window,
GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text (note->w_window,
@@ -587,6 +591,7 @@ stickynote_set_color (StickyNote *note,
GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text (note->w_body,
GTK_STATE_PRELIGHT, NULL);
+#endif
}
if (color_str_actual)