summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes.c
diff options
context:
space:
mode:
Diffstat (limited to 'stickynotes/stickynotes.c')
-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)