summaryrefslogtreecommitdiff
path: root/mate-panel/panel-properties-dialog.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-11-29 14:36:23 +0100
committerStefano Karapetsas <[email protected]>2013-11-29 14:36:23 +0100
commit17fc492a17e8f5317d7438c771ac9c95ce1e0a04 (patch)
treee40ede01db66cccda81ecf1a2c49ad76037ac26c /mate-panel/panel-properties-dialog.c
parent3f71479324ce6896c3cd8a480aacaf588ab159a9 (diff)
downloadmate-panel-17fc492a17e8f5317d7438c771ac9c95ce1e0a04.tar.bz2
mate-panel-17fc492a17e8f5317d7438c771ac9c95ce1e0a04.tar.xz
Panel background improvements for GTK3
Diffstat (limited to 'mate-panel/panel-properties-dialog.c')
-rw-r--r--mate-panel/panel-properties-dialog.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/mate-panel/panel-properties-dialog.c b/mate-panel/panel-properties-dialog.c
index 5818522f..c14dae99 100644
--- a/mate-panel/panel-properties-dialog.c
+++ b/mate-panel/panel-properties-dialog.c
@@ -327,19 +327,32 @@ static void
panel_properties_dialog_color_changed (PanelPropertiesDialog *dialog,
GtkColorButton *color_button)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color;
+#else
GdkColor color;
+#endif
g_assert (dialog->color_button == GTK_WIDGET (color_button));
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_button_get_rgba (color_button, &color);
+ panel_profile_set_background_gdk_rgba_color (dialog->toplevel, &color);
+#else
gtk_color_button_get_color (color_button, &color);
panel_profile_set_background_gdk_color (dialog->toplevel, &color);
+#endif
}
static void
panel_properties_dialog_setup_color_button (PanelPropertiesDialog *dialog,
GtkBuilder *gui)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color;
+#else
PanelColor color;
+#endif
dialog->color_button = PANEL_GTK_BUILDER_GET (gui, "color_button");
g_return_if_fail (dialog->color_button != NULL);
@@ -348,8 +361,13 @@ panel_properties_dialog_setup_color_button (PanelPropertiesDialog *dialog,
panel_profile_get_background_color (dialog->toplevel, &color);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_button_set_rgba (GTK_COLOR_BUTTON (dialog->color_button),
+ &color);
+#else
gtk_color_button_set_color (GTK_COLOR_BUTTON (dialog->color_button),
&(color.gdk));
+#endif
g_signal_connect_swapped (dialog->color_button, "color_set",
G_CALLBACK (panel_properties_dialog_color_changed),
@@ -693,19 +711,36 @@ static void
panel_properties_dialog_update_background_color (PanelPropertiesDialog *dialog,
gchar *str_color)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA new_color;
+ GdkRGBA old_color;
+#else
GdkColor new_color = { 0, };
GdkColor old_color;
+#endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+ if (!gdk_rgba_parse (&new_color, str_color))
+#else
if (!gdk_color_parse (str_color, &new_color))
+#endif
return;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_button_get_rgba (GTK_COLOR_BUTTON (dialog->color_button),
+#else
gtk_color_button_get_color (GTK_COLOR_BUTTON (dialog->color_button),
+#endif
&old_color);
if (old_color.red != new_color.red ||
old_color.green != new_color.green ||
old_color.blue != new_color.blue)
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_color_button_set_rgba (GTK_COLOR_BUTTON (dialog->color_button),
+#else
gtk_color_button_set_color (GTK_COLOR_BUTTON (dialog->color_button),
+#endif
&new_color);
}