[gnome-control-center] bgo#556050 - Make the monitor heading in the RANDR capplet be explicitly black



commit af03baa1bc45fb41477c80bc045568eddd975827
Author: Federico Mena Quintero <federico novell com>
Date:   Wed May 6 13:52:38 2009 -0500

    bgo#556050 - Make the monitor heading in the RANDR capplet be explicitly black
    
    The labels are always painted against a light pastel background.  Using
    the theme's colors makes the label hard to read on 'inverse' themes.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>
---
 capplets/display/ChangeLog        |    9 +++++++++
 capplets/display/xrandr-capplet.c |   18 ++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/capplets/display/ChangeLog b/capplets/display/ChangeLog
index 7791c89..cecff37 100644
--- a/capplets/display/ChangeLog
+++ b/capplets/display/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-06  Federico Mena Quintero  <federico novell com>
+
+	* xrandr-capplet.c (rebuild_current_monitor_label): Make the label
+	of the heading for the current monitor be explicitly black.  We
+	don't want to follow the theme's colors, as the label is always
+	shown against a light pastel background --- using the theme's
+	colors makes the label hard to read on "inverse" themes.  Fixes
+	the gnome-control-center part of bug #556050.
+
 2009-04-11  Matthias Clasen  <mclasen redhat com>
 
 	* display-capplet.glade: Make all mnemonics work. (#578572)
diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index 1054900..e966899 100644
--- a/capplets/display/xrandr-capplet.c
+++ b/capplets/display/xrandr-capplet.c
@@ -477,8 +477,26 @@ rebuild_current_monitor_label (App *app)
 	    g_free (str);
 
 	if (use_color)
+	{
+	    GdkColor black = { 0, 0, 0, 0 };
+
 	    gtk_widget_modify_bg (app->current_monitor_event_box, app->current_monitor_event_box->state, &color);
 
+	    /* Make the label explicitly black.  We don't want it to follow the
+	     * theme's colors, since the label is always shown against a light
+	     * pastel background.  See bgo#556050
+	     */
+	    gtk_widget_modify_fg (app->current_monitor_label, GTK_WIDGET_STATE (app->current_monitor_label), &black);
+	}
+	else
+	{
+	    /* Remove any modifications we did on the label's color */
+	    GtkRcStyle *reset_rc_style;
+
+	    reset_rc_style = gtk_rc_style_new ();
+	    gtk_widget_modify_style (app->current_monitor_label, reset_rc_style); /* takes ownership of, and destroys, the rc style */
+	}
+
 	gtk_event_box_set_visible_window (GTK_EVENT_BOX (app->current_monitor_event_box), use_color);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]