[Sugar-devel] [PATCH artwork 2/2] Don't set color for GtkLabel, do it in containers instead - SL #3974

Manuel Quiñones manuq at laptop.org
Tue Oct 2 00:16:47 EDT 2012


An example of why this is wrong is #3974, in which removing:

SugarAlert GtkLabel { color: @white; }

makes the buttons label recover the right color, as specified in the
rule .buttons {...}

The only exception is in the notebook tabs: setting color there
doesn't paint the labels, so we have to add a rule for labels in tabs,
and then add another rule to make sure labels inside buttons inside
tabs get the right black color.  This patch also adds a comment in the
CSS explaining that.

Signed-off-by: Manuel Quiñones <manuq at laptop.org>
---
 gtk3/theme/gtk-widgets.css.em | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/gtk3/theme/gtk-widgets.css.em b/gtk3/theme/gtk-widgets.css.em
index 56c8678..b9a39d5 100644
--- a/gtk3/theme/gtk-widgets.css.em
+++ b/gtk3/theme/gtk-widgets.css.em
@@ -307,13 +307,19 @@ GtkComboBox .separator {
 
 .notebook tab {
     background-color: @selection_grey;
-    color: @white;
 }
 
+/* Setting white color to the tab labels using only the previous rule */
+/* doesn't work, so we have to set white color to the GtkLabel, and make */
+/* sure the buttons get black color in the next two rules: */
 .notebook tab GtkLabel {
     color: @white;
 }
 
+.notebook tab .button GtkLabel {
+    color: @black;
+}
+
 .notebook tab:active {
     background-color: @toolbar_grey;
 }
@@ -346,10 +352,6 @@ SugarAlert {
     color: @white;
 }
 
-SugarAlert GtkLabel {
-    color: @white;
-}
-
 SugarAlert *:insensitive {
     background-color: @black;
 }
@@ -374,9 +376,6 @@ SugarHTray * , SugarVTray * { background-color: @toolbar_grey;}
 
 SugarPaletteWindowWidget {
     background-color: @black;
-}
-
-SugarPaletteWindowWidget GtkLabel {
     color: @white;
 }
 
@@ -517,10 +516,7 @@ GtkVSeparator, GtkHSeparator,
 .toolbar {
 padding: 0px;
 background-color: @toolbar_grey;
-}
-
-.toolbar GtkLabel {
-    color: @white;
+color: @white;
 }
 
 .toolbar .button,
-- 
1.7.11.4



More information about the Sugar-devel mailing list