[Xfce4-commits] [apps/xfdashboard] 03/05: Add compile-time switches for deprecated functions at GTK+

noreply at xfce.org noreply at xfce.org
Tue Feb 23 22:35:14 CET 2016


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 486914b7e97a5b3bba2e78123817cf445bfa32f1
Author: Stephan Haller <nomad at froevel.de>
Date:   Tue Feb 23 22:32:33 2016 +0100

    Add compile-time switches for deprecated functions at GTK+
---
 plugins/clock-view/plugin.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/plugins/clock-view/plugin.c b/plugins/clock-view/plugin.c
index 6911542..3674973 100644
--- a/plugins/clock-view/plugin.c
+++ b/plugins/clock-view/plugin.c
@@ -90,7 +90,11 @@ static void _plugin_on_settings_color_change(GObject *inObject,
 	widgetColor.alpha=settingsColor->alpha/255.0f;
 
 	/* Set converted color at color button */
+#if GTK_CHECK_VERSION(3, 4, 0)
+	gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(button), &widgetColor);
+#else
 	gtk_color_button_set_rgba(button, &widgetColor);
+#endif
 }
 
 /* A new color was chosen at color button */
@@ -104,7 +108,11 @@ static void _plugin_on_color_button_color_chosen(GtkColorButton *inButton,
 	g_return_if_fail(GTK_IS_COLOR_BUTTON(inButton));
 
 	/* Get color from color button */
+#if GTK_CHECK_VERSION(3, 4, 0)
+	gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(inButton), &widgetColor);
+#else
 	gtk_color_button_get_rgba(inButton, &widgetColor);
+#endif
 
 	/* Convert color for settings */
 	settingsColor.red=MIN(255, (gint)(widgetColor.red*255.0f));
@@ -153,7 +161,11 @@ static void _plugin_configure_setup_color_button(GtkColorButton *inButton,
 	widgetColor.alpha=settingsColor->alpha/255.0f;
 
 	/* Set converted color at color button */
+#if GTK_CHECK_VERSION(3, 4, 0)
+	gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(inButton), &widgetColor);
+#else
 	gtk_color_button_set_rgba(inButton, &widgetColor);
+#endif
 
 	/* Connect signal to store color of new one was chosen at color button */
 	g_signal_connect(inButton,
@@ -200,7 +212,11 @@ static GObject* plugin_configure(XfdashboardPlugin *self, gpointer inUserData)
 	gtk_grid_attach(GTK_GRID(layout), widgetLabel, 0, 0, 1, 1);
 
 	widgetValue=gtk_color_button_new();
+#if GTK_CHECK_VERSION(3, 4, 0)
+	gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(widgetValue), TRUE);
+#else
 	gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(widgetValue), TRUE);
+#endif
 	gtk_color_button_set_title(GTK_COLOR_BUTTON(widgetValue), _("Choose color for hour hand"));
 	_plugin_configure_setup_color_button(GTK_COLOR_BUTTON(widgetValue), settings, "hour-color");
 	gtk_grid_attach_next_to(GTK_GRID(layout), widgetValue, widgetLabel, GTK_POS_RIGHT, 1, 1);
@@ -210,7 +226,11 @@ static GObject* plugin_configure(XfdashboardPlugin *self, gpointer inUserData)
 	gtk_grid_attach(GTK_GRID(layout), widgetLabel, 0, 1, 1, 1);
 
 	widgetValue=gtk_color_button_new();
+#if GTK_CHECK_VERSION(3, 4, 0)
+	gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(widgetValue), TRUE);
+#else
 	gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(widgetValue), TRUE);
+#endif
 	gtk_color_button_set_title(GTK_COLOR_BUTTON(widgetValue), _("Choose color for minute hand"));
 	_plugin_configure_setup_color_button(GTK_COLOR_BUTTON(widgetValue), settings, "minute-color");
 	gtk_grid_attach_next_to(GTK_GRID(layout), widgetValue, widgetLabel, GTK_POS_RIGHT, 1, 1);
@@ -220,7 +240,11 @@ static GObject* plugin_configure(XfdashboardPlugin *self, gpointer inUserData)
 	gtk_grid_attach(GTK_GRID(layout), widgetLabel, 0, 2, 1, 1);
 
 	widgetValue=gtk_color_button_new();
+#if GTK_CHECK_VERSION(3, 4, 0)
+	gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(widgetValue), TRUE);
+#else
 	gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(widgetValue), TRUE);
+#endif
 	gtk_color_button_set_title(GTK_COLOR_BUTTON(widgetValue), _("Choose color for second hand"));
 	_plugin_configure_setup_color_button(GTK_COLOR_BUTTON(widgetValue), settings, "second-color");
 	gtk_grid_attach_next_to(GTK_GRID(layout), widgetValue, widgetLabel, GTK_POS_RIGHT, 1, 1);
@@ -230,7 +254,11 @@ static GObject* plugin_configure(XfdashboardPlugin *self, gpointer inUserData)
 	gtk_grid_attach(GTK_GRID(layout), widgetLabel, 0, 3, 1, 1);
 
 	widgetValue=gtk_color_button_new();
+#if GTK_CHECK_VERSION(3, 4, 0)
+	gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(widgetValue), TRUE);
+#else
 	gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(widgetValue), TRUE);
+#endif
 	gtk_color_button_set_title(GTK_COLOR_BUTTON(widgetValue), _("Choose color for background of second hand"));
 	_plugin_configure_setup_color_button(GTK_COLOR_BUTTON(widgetValue), settings, "background-color");
 	gtk_grid_attach_next_to(GTK_GRID(layout), widgetValue, widgetLabel, GTK_POS_RIGHT, 1, 1);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list