[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 12/25: Port scrollbox GdkColor to GdkRGBA

noreply at xfce.org noreply at xfce.org
Mon Sep 17 00:14:09 CEST 2018


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

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-weather-plugin.

commit b73d9dabcee60d43464b3d0711201f036d6c9976
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Wed Sep 12 06:39:16 2018 -0400

    Port scrollbox GdkColor to GdkRGBA
---
 panel-plugin/weather-config.c    |  4 ++--
 panel-plugin/weather-debug.c     |  2 +-
 panel-plugin/weather-scrollbox.c | 13 +++++++++----
 panel-plugin/weather-scrollbox.h |  2 +-
 panel-plugin/weather.c           |  4 ++--
 panel-plugin/weather.h           |  2 +-
 6 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index bdd8636..d95b043 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -1197,7 +1197,7 @@ button_scrollbox_color_set(GtkWidget *button,
 {
     xfceweather_dialog *dialog = (xfceweather_dialog *) user_data;
 
-    gtk_color_button_get_color(GTK_COLOR_BUTTON(button),
+    gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(button),
                                &(dialog->pd->scrollbox_color));
     gtk_scrollbox_set_color(GTK_SCROLLBOX(dialog->pd->scrollbox),
                             dialog->pd->scrollbox_color);
@@ -1564,7 +1564,7 @@ create_scrollbox_page(xfceweather_dialog *dialog)
         gtk_button_set_label(GTK_BUTTON(dialog->button_scrollbox_font),
                              dialog->pd->scrollbox_font);
     dialog->button_scrollbox_color = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_scrollbox_color"));
-    gtk_color_button_set_color (GTK_COLOR_BUTTON (dialog->button_scrollbox_color), &(dialog->pd->scrollbox_color));
+    gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog->button_scrollbox_color), &(dialog->pd->scrollbox_color));
 
     /* labels and buttons */
     dialog->options_datatypes = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "options_datatypes"));
diff --git a/panel-plugin/weather-debug.c b/panel-plugin/weather-debug.c
index c168b8e..9f57c97 100644
--- a/panel-plugin/weather-debug.c
+++ b/panel-plugin/weather-debug.c
@@ -501,7 +501,7 @@ weather_dump_plugindata(const plugin_data *data)
                            YESNO(data->show_scrollbox),
                            data->scrollbox_lines,
                            data->scrollbox_font,
-                           gdk_color_to_string(&(data->scrollbox_color)),
+                           gdk_rgba_to_string(&(data->scrollbox_color)),
                            YESNO(data->scrollbox_use_color),
                            YESNO(data->scrollbox_animate));
     g_free(next_wakeup);
diff --git a/panel-plugin/weather-scrollbox.c b/panel-plugin/weather-scrollbox.c
index 76abef1..89e7928 100644
--- a/panel-plugin/weather-scrollbox.c
+++ b/panel-plugin/weather-scrollbox.c
@@ -575,15 +575,20 @@ gtk_scrollbox_set_fontname(GtkScrollbox *self,
 
 void
 gtk_scrollbox_set_color(GtkScrollbox *self,
-                        const GdkColor color)
+                        const GdkRGBA color)
 {
     PangoAttribute *pattr;
+    guint16 red, green, blue;
 
     g_return_if_fail(GTK_IS_SCROLLBOX(self));
 
-    pattr = pango_attr_foreground_new(color.red,
-                                      color.green,
-                                      color.blue);
+    red = (guint16) (color.red * 65535);
+    green = (guint16) (color.green * 65535);
+    blue = (guint16) (color.blue * 65535);
+
+    pattr = pango_attr_foreground_new(red,
+                                      green,
+                                      blue);
     pango_attr_list_change(self->pattr_list, pattr);
 
     /* update all labels */
diff --git a/panel-plugin/weather-scrollbox.h b/panel-plugin/weather-scrollbox.h
index 648c67e..07093cc 100644
--- a/panel-plugin/weather-scrollbox.h
+++ b/panel-plugin/weather-scrollbox.h
@@ -98,7 +98,7 @@ void gtk_scrollbox_set_fontname(GtkScrollbox *self,
                                 const gchar *fontname);
 
 void gtk_scrollbox_set_color(GtkScrollbox *self,
-                             const GdkColor color);
+                             const GdkRGBA color);
 
 void gtk_scrollbox_clear_color(GtkScrollbox *self);
 
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index cc9aedc..b318f02 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -901,7 +901,7 @@ xfceweather_read_config(XfcePanelPlugin *plugin,
 
     value = xfce_rc_read_entry(rc, "scrollbox_color", NULL);
     if (value)
-        gdk_color_parse(value, &(data->scrollbox_color));
+        gdk_rgba_parse(&(data->scrollbox_color), value);
 
     data->scrollbox_use_color =
         xfce_rc_read_bool_entry(rc, "scrollbox_use_color", FALSE);
@@ -1000,7 +1000,7 @@ xfceweather_write_config(XfcePanelPlugin *plugin,
     if (data->scrollbox_font)
         xfce_rc_write_entry(rc, "scrollbox_font", data->scrollbox_font);
 
-    value = gdk_color_to_string(&(data->scrollbox_color));
+    value = gdk_rgba_to_string(&(data->scrollbox_color));
     xfce_rc_write_entry(rc, "scrollbox_color", value);
     g_free(value);
 
diff --git a/panel-plugin/weather.h b/panel-plugin/weather.h
index 6556682..dce47bc 100644
--- a/panel-plugin/weather.h
+++ b/panel-plugin/weather.h
@@ -104,7 +104,7 @@ typedef struct {
     gboolean show_scrollbox;
     gint scrollbox_lines;
     gchar *scrollbox_font;
-    GdkColor scrollbox_color;
+    GdkRGBA scrollbox_color;
     gboolean scrollbox_use_color;
     gboolean scrollbox_animate;
     GArray *labels;

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


More information about the Xfce4-commits mailing list