]> Dogcows Code - chaz/openbox/blobdiff - render/theme.c
1) translate all of openbox's output
[chaz/openbox] / render / theme.c
index 933114e0a60d51454ef2d46ff153194a18d082cc..8d61d23de99c2cb6c0468a7366ff74dfd17eade2 100644 (file)
@@ -76,15 +76,19 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
 
     if (name) {
         if (!parse_load_theme(name, &ps.doc, &root, &ps.path)) {
-            g_warning("Falling back to the default theme: '%s'",
+            g_message("Unable to load the theme '%s'", name);
+            g_message("Falling back to the default theme '%s'",
                       DEFAULT_THEME);
             /* make it fall back to default theme */
             name = NULL;
         }
     }
     if (!name) {
-        if (!parse_load_theme(DEFAULT_THEME, &ps.doc, &root, &ps.path))
+        if (!parse_load_theme(DEFAULT_THEME, &ps.doc, &root, &ps.path)) {
+            g_message("Unable to load the theme '%s'",
+                      name, DEFAULT_THEME);
             return NULL;
+        }
     }
     ps.inst = inst;
 
@@ -115,7 +119,8 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
     theme->a_focused_handle = RrAppearanceNew(inst, 0);
     theme->a_unfocused_handle = RrAppearanceNew(inst, 0);
     theme->a_menu = RrAppearanceNew(inst, 0);
-    theme->a_menu_title = RrAppearanceNew(inst, 1);
+    theme->a_menu_title = RrAppearanceNew(inst, 0);
+    theme->a_menu_text_title = RrAppearanceNew(inst, 1);
     theme->a_menu_normal = RrAppearanceNew(inst, 0);
     theme->a_menu_disabled = RrAppearanceNew(inst, 0);
     theme->a_menu_selected = RrAppearanceNew(inst, 0);
@@ -304,17 +309,17 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
               &theme->titlebut_toggled_hover_focused_color, NULL))
         theme->titlebut_toggled_hover_focused_color =
             RrColorNew(inst,
-                       theme->titlebut_focused_unpressed_color->r,
-                       theme->titlebut_focused_unpressed_color->g,
-                       theme->titlebut_focused_unpressed_color->b);
+                       theme->titlebut_toggled_focused_unpressed_color->r,
+                       theme->titlebut_toggled_focused_unpressed_color->g,
+                       theme->titlebut_toggled_focused_unpressed_color->b);
     if (!FIND(color,
               L("window","inactive","buttons","toggled-hover","image"),
               &theme->titlebut_toggled_hover_unfocused_color, NULL))
         theme->titlebut_toggled_hover_unfocused_color =
             RrColorNew(inst,
-                       theme->titlebut_unfocused_unpressed_color->r,
-                       theme->titlebut_unfocused_unpressed_color->g,
-                       theme->titlebut_unfocused_unpressed_color->b);
+                       theme->titlebut_toggled_unfocused_unpressed_color->r,
+                       theme->titlebut_toggled_unfocused_unpressed_color->g,
+                       theme->titlebut_toggled_unfocused_unpressed_color->b);
     if (!FIND(color, L("menu","title","text","primary"),
               &theme->menu_title_color, NULL))
         theme->menu_title_color = RrColorNew(inst, 0, 0, 0);
@@ -413,10 +418,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         theme->max_pressed_mask = RrPixmapMaskCopy(theme->max_mask);
         theme->max_disabled_mask = RrPixmapMaskCopy(theme->max_mask);
         theme->max_hover_mask = RrPixmapMaskCopy(theme->max_mask);
-        theme->desk_toggled_pressed_mask =
-            RrPixmapMaskCopy(theme->desk_toggled_mask);
-        theme->desk_toggled_hover_mask =
-            RrPixmapMaskCopy(theme->desk_toggled_mask);
+        theme->max_toggled_pressed_mask =
+            RrPixmapMaskCopy(theme->max_toggled_mask);
+        theme->max_toggled_hover_mask =
+            RrPixmapMaskCopy(theme->max_toggled_mask);
     }
 
     if (read_mask(&ps, "iconify.xbm", &theme->iconify_mask)) {
@@ -567,7 +572,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         set_default_appearance(theme->a_unfocused_grip);
     if (!FIND(appearance, L("menu","entries"), theme->a_menu, FALSE))
         set_default_appearance(theme->a_menu);
-    if (!FIND(appearance, L("menu","title"), theme->a_menu_title, FALSE))
+    if (!FIND(appearance, L("menu","title"), theme->a_menu_title, TRUE))
         set_default_appearance(theme->a_menu_title);
     if (!FIND(appearance, L("menu", "active"), theme->a_menu_selected, TRUE))
         set_default_appearance(theme->a_menu_selected);
@@ -650,14 +655,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
     {
         RrAppearanceFree(theme->a_toggled_hover_focused_max);
         theme->a_toggled_hover_focused_max =
-            RrAppearanceCopy(theme->a_focused_unpressed_max);
+            RrAppearanceCopy(theme->a_toggled_focused_unpressed_max);
     }
     if (!FIND(appearance, L("window","inactive","buttons","toggled-hover"),
               theme->a_toggled_hover_unfocused_max, TRUE))
     {
         RrAppearanceFree(theme->a_toggled_hover_unfocused_max);
         theme->a_toggled_hover_unfocused_max =
-            RrAppearanceCopy(theme->a_unfocused_unpressed_max);
+            RrAppearanceCopy(theme->a_toggled_unfocused_unpressed_max);
     }
 
    theme->a_disabled_focused_close =
@@ -752,6 +757,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
     theme->a_icon->surface.grad =
         theme->a_clear->surface.grad =
         theme->a_clear_tex->surface.grad =
+        theme->a_menu_text_title->surface.grad =
         theme->a_menu_normal->surface.grad =
         theme->a_menu_disabled->surface.grad =
         theme->a_menu_text_normal->surface.grad =
@@ -811,18 +817,20 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
     theme->a_unfocused_label->texture[0].data.text.shadow_alpha =
         theme->title_unfocused_shadow_alpha;
 
-    theme->a_menu_title->texture[0].type = RR_TEXTURE_TEXT;
-    theme->a_menu_title->texture[0].data.text.justify = mtitlejust;
-    theme->a_menu_title->texture[0].data.text.font = theme->menu_title_font;
-    theme->a_menu_title->texture[0].data.text.color = theme->menu_title_color;
+    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 =
+        theme->menu_title_font;
+    theme->a_menu_text_title->texture[0].data.text.color =
+        theme->menu_title_color;
 
     if (!FIND(shadow, L("menu","title","text","shadow","offset"),
-              theme->a_menu_title))
-        theme->a_menu_title->texture[0].data.text.shadow_offset_x =
-            theme->a_menu_title->texture[0].data.text.shadow_offset_y = 0;
-    theme->a_menu_title->texture[0].data.text.shadow_color =
+              theme->a_menu_text_title))
+        theme->a_menu_text_title->texture[0].data.text.shadow_offset_x =
+            theme->a_menu_text_title->texture[0].data.text.shadow_offset_y = 0;
+    theme->a_menu_text_title->texture[0].data.text.shadow_color =
         theme->menu_title_shadow_color;
-    theme->a_menu_title->texture[0].data.text.shadow_alpha =
+    theme->a_menu_text_title->texture[0].data.text.shadow_alpha =
         theme->menu_title_shadow_alpha;
 
     theme->a_menu_text_normal->texture[0].type =
@@ -1117,7 +1125,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
             MAX(theme->win_font_height,
                 RrFontHeight(theme->win_font_unfocused,
                              a->texture[0].data.text.shadow_offset_y));
-        a = theme->a_menu_title;
+        a = theme->a_menu_text_title;
         theme->menu_title_font_height =
             RrFontHeight(theme->menu_title_font,
                          a->texture[0].data.text.shadow_offset_y);
@@ -1294,6 +1302,7 @@ void RrThemeFree(RrTheme *theme)
         RrAppearanceFree(theme->a_unfocused_handle);
         RrAppearanceFree(theme->a_menu);
         RrAppearanceFree(theme->a_menu_title);
+        RrAppearanceFree(theme->a_menu_text_title);
         RrAppearanceFree(theme->a_menu_normal);
         RrAppearanceFree(theme->a_menu_disabled);
         RrAppearanceFree(theme->a_menu_selected);
This page took 0.026696 seconds and 4 git commands to generate.