]> Dogcows Code - chaz/openbox/blobdiff - render/theme.c
update which files have translatable strings
[chaz/openbox] / render / theme.c
index 26f67c4d379b961a7b03bbef780b7c9f813bc07f..6e097bd618aa699f5a35d95e2cf603125a272d7e 100644 (file)
@@ -26,7 +26,7 @@ static void set_default_appearance(RrAppearance *a);
 RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
 {
     XrmDatabase db = NULL;
-    RrJustify winjust, mtitlejust, mjust;
+    RrJustify winjust, mtitlejust;
     gchar *str;
     gchar *font_str;
     RrTheme *theme;
@@ -143,14 +143,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
     }
     theme->mfont_height = RrFontHeight(theme->mfont);
 
-    mjust = RR_JUSTIFY_LEFT;
-    if (read_string(db, "menu.frame.justify", &str)) {
-        if (!g_ascii_strcasecmp(str, "right"))
-            mjust = RR_JUSTIFY_RIGHT;
-        else if (!g_ascii_strcasecmp(str, "center"))
-            mjust = RR_JUSTIFY_CENTER;
-    }
-
     /* load direct dimensions */
     if (!read_int(db, "menuOverlap", &theme->menu_overlap) ||
        theme->menu_overlap < 0 || theme->menu_overlap > 20)
@@ -413,8 +405,8 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
     }
 
     if (!read_mask(inst, "bullet.xbm", theme, &theme->menu_bullet_mask)) {
-        guchar data[] = { 0x18, 0x30, 0x60, 0xfe, 0xfe, 0x60, 0x30, 0x18 };
-        theme->menu_bullet_mask = RrPixmapMaskNew(inst, 8, 8, (char*)data);
+        guchar data[] = { 0x01, 0x03, 0x07, 0x0f, 0x07, 0x03, 0x01 };
+        theme->menu_bullet_mask = RrPixmapMaskNew(inst, 4, 7, (char*)data);
     }
 
     /* read the decoration textures */
@@ -506,14 +498,20 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
                          "window.button.toggled.focus",
                         theme->a_toggled_focused_max,
                          TRUE))
+    {
+        RrAppearanceFree(theme->a_toggled_focused_max);
         theme->a_toggled_focused_max =
             RrAppearanceCopy(theme->a_focused_pressed_max);
+    }
     if (!read_appearance(db, inst,
                          "window.button.toggled.unfocus",
                         theme->a_toggled_unfocused_max,
                          TRUE))
+    {
+        RrAppearanceFree(theme->a_toggled_unfocused_max);
         theme->a_toggled_unfocused_max =
             RrAppearanceCopy(theme->a_unfocused_pressed_max);
+    }
     if (!read_appearance(db, inst,
                          "window.button.focus",
                         theme->a_focused_unpressed_max,
@@ -528,14 +526,20 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
                          "window.button.hover.focus",
                         theme->a_hover_focused_max,
                          TRUE))
+    {
+        RrAppearanceFree(theme->a_hover_focused_max);
         theme->a_hover_focused_max =
             RrAppearanceCopy(theme->a_focused_unpressed_max);
+    }
     if (!read_appearance(db, inst,
                          "window.button.hover.unfocus",
                         theme->a_hover_unfocused_max,
                          TRUE))
+    {
+        RrAppearanceFree(theme->a_hover_unfocused_max);
         theme->a_hover_unfocused_max =
             RrAppearanceCopy(theme->a_unfocused_unpressed_max);
+    }
 
     theme->a_disabled_focused_close =
         RrAppearanceCopy(theme->a_disabled_focused_max);
@@ -653,7 +657,8 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
         theme->a_menu_text_hilite->texture[0].type = RR_TEXTURE_TEXT;
     theme->a_menu_text_item->texture[0].data.text.justify = 
         theme->a_menu_text_disabled->texture[0].data.text.justify = 
-        theme->a_menu_text_hilite->texture[0].data.text.justify = mjust;
+        theme->a_menu_text_hilite->texture[0].data.text.justify =
+        RR_JUSTIFY_LEFT;
     theme->a_menu_text_item->texture[0].data.text.font =
         theme->a_menu_text_disabled->texture[0].data.text.font =
         theme->a_menu_text_hilite->texture[0].data.text.font = theme->mfont;
@@ -877,6 +882,7 @@ void RrThemeFree(RrTheme *theme)
         RrColorFree(theme->menu_title_color);
         RrColorFree(theme->menu_disabled_color);
         RrColorFree(theme->menu_hilite_color);
+        RrColorFree(theme->menu_bullet_color);
 
         RrPixmapMaskFree(theme->max_mask);
         RrPixmapMaskFree(theme->max_toggled_mask);
This page took 0.021947 seconds and 4 git commands to generate.