[Xfce4-commits] <xfce4-systemload-plugin:master> Fix bar colors for some theme engines

Florian Rivoal noreply at xfce.org
Thu Oct 14 17:20:03 CEST 2010


Updating branch refs/heads/master
         to ff5c610d382bb0f8607e85a6d0ca75aaf8f497b8 (commit)
       from 3f4905e77345a6c381912dbc53d3462700d400a9 (commit)

commit ff5c610d382bb0f8607e85a6d0ca75aaf8f497b8
Author: Florian Rivoal <frivoal at xfce.org>
Date:   Mon Oct 11 01:59:20 2010 +0900

    Fix bar colors for some theme engines
    
    Apply the patch proposed in bug 3588.

 panel-plugin/systemload.c |   40 ++++++++++++++++++----------------------
 1 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/panel-plugin/systemload.c b/panel-plugin/systemload.c
index 5e53418..98a3c16 100644
--- a/panel-plugin/systemload.c
+++ b/panel-plugin/systemload.c
@@ -254,17 +254,16 @@ monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation orientation,
         gtk_container_add(GTK_CONTAINER(global->monitor[count]->ebox),
                           GTK_WIDGET(global->monitor[count]->box));
 
-        rc = gtk_widget_get_modifier_style(GTK_WIDGET(global->monitor[count]->status));
-        if (!rc) {
-            rc = gtk_rc_style_new();
-        }
-        if (rc) {
-            rc->color_flags[GTK_STATE_PRELIGHT] |= GTK_RC_BG;
-            rc->bg[GTK_STATE_PRELIGHT] =
-                global->monitor[count]->options.color;
-        }
+        gtk_widget_modify_bg(GTK_WIDGET(global->monitor[count]->status),
+                             GTK_STATE_PRELIGHT,
+                             &global->monitor[count]->options.color);
+        gtk_widget_modify_bg(GTK_WIDGET(global->monitor[count]->status),
+                             GTK_STATE_SELECTED,
+                             &global->monitor[count]->options.color);
+        gtk_widget_modify_base(GTK_WIDGET(global->monitor[count]->status),
+                               GTK_STATE_SELECTED,
+                               &global->monitor[count]->options.color);
 
-        gtk_widget_modify_style(GTK_WIDGET(global->monitor[count]->status), rc);
         gtk_widget_show(GTK_WIDGET(global->monitor[count]->status));
 
         gtk_box_pack_start(GTK_BOX(global->monitor[count]->box),
@@ -380,18 +379,15 @@ setup_monitor(t_global_monitor *global)
         gtk_label_set_text(GTK_LABEL(global->monitor[count]->label),
                            global->monitor[count]->options.label_text);
 
-        gtk_widget_hide(GTK_WIDGET(global->monitor[count]->status));
-        rc = gtk_widget_get_modifier_style(GTK_WIDGET(global->monitor[count]->status));
-        if (!rc) {
-            rc = gtk_rc_style_new();
-        }
-
-        if (rc) {
-            rc->color_flags[GTK_STATE_PRELIGHT] |= GTK_RC_BG;
-            rc->bg[GTK_STATE_PRELIGHT] = global->monitor[count]->options.color;
-        }
-
-        gtk_widget_modify_style(GTK_WIDGET(global->monitor[count]->status), rc);
+        gtk_widget_modify_bg(GTK_WIDGET(global->monitor[count]->status),
+                             GTK_STATE_PRELIGHT,
+                             &global->monitor[count]->options.color);
+        gtk_widget_modify_bg(GTK_WIDGET(global->monitor[count]->status),
+                             GTK_STATE_SELECTED,
+                             &global->monitor[count]->options.color);
+        gtk_widget_modify_base(GTK_WIDGET(global->monitor[count]->status),
+                               GTK_STATE_SELECTED,
+                               &global->monitor[count]->options.color);
 
         if(global->monitor[count]->options.enabled)
         {



More information about the Xfce4-commits mailing list