]> Dogcows Code - chaz/openbox/commitdiff
Fix ordering so fallback for inactive osd to label works
authorMikael Magnusson <mikachu@gmail.com>
Mon, 11 Jan 2010 00:27:30 +0000 (01:27 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Mon, 11 Jan 2010 00:27:30 +0000 (01:27 +0100)
The themeing options (sic) for inactive osd labels added in
cfdbe23e0d9b72b4c220a10ddf60a4e981967b63 had the fallback to inactive
label before that was read in, so fallback failed to pick up some
things.

obrender/theme.c

index 6c136bf541f541cbc6a79da8de34ef626445022d..43fb0dd1e95bf167c4848d5629bdfeb6f93f2f46 100644 (file)
@@ -932,13 +932,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
     theme->osd_hilite_label->texture[0].data.text.color =
         theme->osd_text_active_color;
 
-    theme->osd_unhilite_label->texture[0].type = RR_TEXTURE_TEXT;
-    theme->osd_unhilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT;
-    theme->osd_unhilite_label->texture[0].data.text.font =
-        theme->osd_font_unhilite;
-    theme->osd_unhilite_label->texture[0].data.text.color =
-        theme->osd_text_inactive_color;
-
     if (read_string(db, "osd.active.label.text.font", &str) ||
         read_string(db, "osd.label.text.font", &str))
     {
@@ -988,6 +981,51 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
     theme->osd_hilite_label->texture[0].data.text.shadow_alpha =
         theme->osd_text_active_shadow_alpha;
 
+    theme->a_unfocused_label->texture[0].type = RR_TEXTURE_TEXT;
+    theme->a_unfocused_label->texture[0].data.text.justify = winjust;
+    theme->a_unfocused_label->texture[0].data.text.font =
+        theme->win_font_unfocused;
+    theme->a_unfocused_label->texture[0].data.text.color =
+        theme->title_unfocused_color;
+
+    if (read_string(db, "window.inactive.label.text.font", &str)) {
+        char *p;
+        gint i = 0;
+        gint j;
+        if (strstr(str, "shadow=y")) {
+            if ((p = strstr(str, "shadowoffset=")))
+                i = parse_inline_number(p + strlen("shadowoffset="));
+            else
+                i = 1;
+            theme->a_unfocused_label->texture[0].data.text.shadow_offset_x = i;
+            theme->a_unfocused_label->texture[0].data.text.shadow_offset_y = i;
+        }
+        if ((p = strstr(str, "shadowtint=")))
+        {
+            i = parse_inline_number(p + strlen("shadowtint="));
+            j = (i > 0 ? 0 : 255);
+            i = ABS(i*255/100);
+
+            theme->title_unfocused_shadow_color = RrColorNew(inst, j, j, j);
+            theme->title_unfocused_shadow_alpha = i;
+        } else {
+            theme->title_unfocused_shadow_color = RrColorNew(inst, 0, 0, 0);
+            theme->title_unfocused_shadow_alpha = 50;
+        }
+    }
+
+    theme->a_unfocused_label->texture[0].data.text.shadow_color =
+        theme->title_unfocused_shadow_color;
+    theme->a_unfocused_label->texture[0].data.text.shadow_alpha =
+        theme->title_unfocused_shadow_alpha;
+
+    theme->osd_unhilite_label->texture[0].type = RR_TEXTURE_TEXT;
+    theme->osd_unhilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT;
+    theme->osd_unhilite_label->texture[0].data.text.font =
+        theme->osd_font_unhilite;
+    theme->osd_unhilite_label->texture[0].data.text.color =
+        theme->osd_text_inactive_color;
+
     if (read_string(db, "osd.inactive.label.text.font", &str))
     {
         char *p;
@@ -1014,7 +1052,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
             theme->osd_text_inactive_shadow_alpha = 50;
         }
     } else {
-        /* inherit the font settings from the focused label */
+        /* inherit the font settings from the unfocused label */
         theme->osd_unhilite_label->texture[0].data.text.shadow_offset_x =
             theme->a_unfocused_label->texture[0].data.text.shadow_offset_x;
         theme->osd_unhilite_label->texture[0].data.text.shadow_offset_y =
@@ -1036,44 +1074,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
     theme->osd_unhilite_label->texture[0].data.text.shadow_alpha =
         theme->osd_text_inactive_shadow_alpha;
 
-    theme->a_unfocused_label->texture[0].type = RR_TEXTURE_TEXT;
-    theme->a_unfocused_label->texture[0].data.text.justify = winjust;
-    theme->a_unfocused_label->texture[0].data.text.font =
-        theme->win_font_unfocused;
-    theme->a_unfocused_label->texture[0].data.text.color =
-        theme->title_unfocused_color;
-
-    if (read_string(db, "window.inactive.label.text.font", &str)) {
-        char *p;
-        gint i = 0;
-        gint j;
-        if (strstr(str, "shadow=y")) {
-            if ((p = strstr(str, "shadowoffset=")))
-                i = parse_inline_number(p + strlen("shadowoffset="));
-            else
-                i = 1;
-            theme->a_unfocused_label->texture[0].data.text.shadow_offset_x = i;
-            theme->a_unfocused_label->texture[0].data.text.shadow_offset_y = i;
-        }
-        if ((p = strstr(str, "shadowtint=")))
-        {
-            i = parse_inline_number(p + strlen("shadowtint="));
-            j = (i > 0 ? 0 : 255);
-            i = ABS(i*255/100);
-
-            theme->title_unfocused_shadow_color = RrColorNew(inst, j, j, j);
-            theme->title_unfocused_shadow_alpha = i;
-        } else {
-            theme->title_unfocused_shadow_color = RrColorNew(inst, 0, 0, 0);
-            theme->title_unfocused_shadow_alpha = 50;
-        }
-    }
-
-    theme->a_unfocused_label->texture[0].data.text.shadow_color =
-        theme->title_unfocused_shadow_color;
-    theme->a_unfocused_label->texture[0].data.text.shadow_alpha =
-        theme->title_unfocused_shadow_alpha;
-
     theme->a_menu_text_title->texture[0].type = RR_TEXTURE_TEXT;
     theme->a_menu_text_title->texture[0].data.text.justify = mtitlejust;
     theme->a_menu_text_title->texture[0].data.text.font =
This page took 0.029081 seconds and 4 git commands to generate.