[PATCH 1/3] Move the layout indicator color to css and fix the colors

David Shea dshea at redhat.com
Tue Dec 9 20:47:43 UTC 2014


If you set the background color, you have to set the foreground color,
too, because a productimg css file might come along and change one of
those out from under you and now you can't see the keyboard logo
anymore.

Move the whole thing into CSS to take care of the TODO comment and also
because the methods we were using are deprecated now.
---
 data/anaconda-gtk.css         | 6 ++++++
 widgets/src/LayoutIndicator.c | 8 --------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/data/anaconda-gtk.css b/data/anaconda-gtk.css
index a92542e..e96a0ba 100644
--- a/data/anaconda-gtk.css
+++ b/data/anaconda-gtk.css
@@ -198,3 +198,9 @@ AnacondaSpokeSelector:insensitive {
 GtkTreeView.solid-separator {
     -GtkTreeView-horizontal-separator: 0;
 }
+
+/* Set the layout indicator colors */
+AnacondaLayoutIndicator {
+    background-color: #fdfdfd;
+    color: black;
+}
diff --git a/widgets/src/LayoutIndicator.c b/widgets/src/LayoutIndicator.c
index e872b89..f7fffad 100644
--- a/widgets/src/LayoutIndicator.c
+++ b/widgets/src/LayoutIndicator.c
@@ -143,7 +143,6 @@ GtkWidget *anaconda_layout_indicator_new() {
 static void anaconda_layout_indicator_init(AnacondaLayoutIndicator *self) {
     AtkObject *atk;
     GdkDisplay *display;
-    GdkRGBA background_color = { 0.0, 0.0, 0.0, 0.0 };
     AnacondaLayoutIndicatorClass *klass = ANACONDA_LAYOUT_INDICATOR_GET_CLASS(self);
 
     if (!klass->engine) {
@@ -165,8 +164,6 @@ static void anaconda_layout_indicator_init(AnacondaLayoutIndicator *self) {
         gdk_window_add_filter(NULL, (GdkFilterFunc) handle_xevent, klass->engine);
     }
 
-    g_return_if_fail(gdk_rgba_parse(&background_color, "#fdfdfd"));
-
     self->priv = G_TYPE_INSTANCE_GET_PRIVATE(self,
                                              ANACONDA_TYPE_LAYOUT_INDICATOR,
                                              AnacondaLayoutIndicatorPrivate);
@@ -191,11 +188,6 @@ static void anaconda_layout_indicator_init(AnacondaLayoutIndicator *self) {
                      G_CALLBACK(anaconda_layout_indicator_realize),
                      NULL);
 
-    /* layout indicator should have a different background color
-       TODO: should be "exported" to allow changes in glade from code? */
-    gtk_widget_override_background_color(GTK_WIDGET(self),
-                                         GTK_STATE_FLAG_NORMAL, &background_color);
-
     /* initialize XklConfigRec instance providing data */
     self->priv->config_rec = xkl_config_rec_new();
     xkl_config_rec_get_from_server(self->priv->config_rec, klass->engine);
-- 
2.1.0



More information about the anaconda-patches mailing list