[Xfce4-commits] <xfce4-weather-plugin:master> Set text color on alternate cells in forecast table (bug #9150).

Harald Judt noreply at xfce.org
Thu Jul 26 21:18:01 CEST 2012


Updating branch refs/heads/master
         to edf26ee19cb84979d4728dadaa2d735073eb3efe (commit)
       from 76ff368964e80e359502e175eaa136449e7343e5 (commit)

commit edf26ee19cb84979d4728dadaa2d735073eb3efe
Author: Harald Judt <h.judt at gmx.at>
Date:   Thu Jul 26 21:10:14 2012 +0200

    Set text color on alternate cells in forecast table (bug #9150).
    
    Since the background is set manually, the text color needs to be
    set too, or it might be hard to read with some themes.

 panel-plugin/weather-summary.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index c96fafa..4813232 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -476,6 +476,7 @@ make_forecast(xfceweather_data *data)
     GtkWidget *table, *ebox, *box, *align;
     GtkWidget *forecast_box, *label, *image;
     GdkPixbuf *icon;
+    GdkColor black = {0, 0x0000, 0x0000, 0x0000};
     GdkColor lightbg = {0, 0xeaea, 0xeaea, 0xeaea};
     GdkColor darkbg = {0, 0x6666, 0x6666, 0x6666};
     gint i, weekday, daytime;
@@ -556,6 +557,9 @@ make_forecast(xfceweather_data *data)
                     g_free(rawvalue);
                     label = gtk_label_new(NULL);
                     gtk_label_set_markup(GTK_LABEL(label), value);
+                    if (!(i % 2))
+                        gtk_widget_modify_fg(GTK_WIDGET(label),
+                                             GTK_STATE_NORMAL, &black);
                     gtk_box_pack_start(GTK_BOX(forecast_box), GTK_WIDGET(label),
                                        TRUE, TRUE, 0);
                     g_free(value);
@@ -567,6 +571,9 @@ make_forecast(xfceweather_data *data)
                                                      TEMPERATURE));
                     g_free(rawvalue);
                     label = gtk_label_new(value);
+                    if (!(i % 2))
+                        gtk_widget_modify_fg(GTK_WIDGET(label),
+                                             GTK_STATE_NORMAL, &black);
                     gtk_box_pack_start(GTK_BOX(forecast_box), GTK_WIDGET(label),
                                        TRUE, TRUE, 0);
                     g_free(value);
@@ -584,6 +591,9 @@ make_forecast(xfceweather_data *data)
                     g_free(wind_direction);
                     g_free(rawvalue);
                     label = gtk_label_new(value);
+                    if (!(i % 2))
+                        gtk_widget_modify_fg(GTK_WIDGET(label),
+                                             GTK_STATE_NORMAL, &black);
                     gtk_box_pack_start(GTK_BOX(forecast_box), label,
                                        TRUE, TRUE, 0);
                     g_free(value);


More information about the Xfce4-commits mailing list