summaryrefslogtreecommitdiff
path: root/logview
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-08-07 15:13:12 +0200
committerraveit65 <[email protected]>2016-09-01 08:21:55 +0200
commit0c53fd04dd18eb578398526973decf9360c0183c (patch)
tree1798a58ef476589dec56536aeddc6bdfc672d250 /logview
parent5b0b7091d7f3338df67064ea057a9ce49e47608a (diff)
downloadmate-utils-0c53fd04dd18eb578398526973decf9360c0183c.tar.bz2
mate-utils-0c53fd04dd18eb578398526973decf9360c0183c.tar.xz
GTK+-3 logview-filter-manger: don't use deprecated GdkColor
taken from: https://git.gnome.org/browse/gnome-system-log/commit/?id=db81a5e
Diffstat (limited to 'logview')
-rw-r--r--logview/src/logview-filter-manager.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/logview/src/logview-filter-manager.c b/logview/src/logview-filter-manager.c
index cb9be966..080e012a 100644
--- a/logview/src/logview-filter-manager.c
+++ b/logview/src/logview-filter-manager.c
@@ -213,6 +213,23 @@ on_dialog_add_edit_reponse (GtkWidget *dialog, int response_id,
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_color))) {
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_foreground))) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA foreground_color;
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (color_foreground),
+ &foreground_color);
+ g_object_set (G_OBJECT (tag),
+ "foreground-rgba", &foreground_color,
+ "foreground-set", TRUE, NULL);
+ }
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_background))) {
+ GdkRGBA background_color;
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (color_background),
+ &background_color);
+ g_object_set (tag,
+ "paragraph-background-rgba", &background_color,
+ "paragraph-background-set", TRUE, NULL);
+#else
GdkColor foreground_color;
gtk_color_button_get_color (GTK_COLOR_BUTTON (color_foreground),
&foreground_color);
@@ -228,6 +245,7 @@ on_dialog_add_edit_reponse (GtkWidget *dialog, int response_id,
g_object_set (tag,
"paragraph-background-gdk", &background_color,
"paragraph-background-set", TRUE, NULL);
+#endif
}
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_foreground))
@@ -350,6 +368,29 @@ run_add_edit_dialog (LogviewFilterManager *manager, LogviewFilter *filter)
gtk_entry_set_text (GTK_ENTRY(entry_regex), regex);
if (foreground_set) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA *foreground;
+
+ g_object_get (tag, "foreground-rgba", &foreground, NULL);
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_foreground),
+ foreground);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_foreground),
+ TRUE);
+
+ gdk_rgba_free (foreground);
+ }
+
+ if (background_set) {
+ GdkRGBA *background;
+
+ g_object_get (tag, "paragraph-background-rgba", &background, NULL);
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_background),
+ background);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_background),
+ TRUE);
+
+ gdk_rgba_free (background);
+#else
GdkColor *foreground;
g_object_get (tag, "foreground-gdk", &foreground, NULL);
@@ -371,6 +412,7 @@ run_add_edit_dialog (LogviewFilterManager *manager, LogviewFilter *filter)
TRUE);
gdk_color_free (background);
+#endif
}
if (background_set || foreground_set) {