]> Dogcows Code - chaz/openbox/commitdiff
load and set the titles justification
authorDana Jansens <danakj@orodu.net>
Mon, 17 Mar 2003 01:26:15 +0000 (01:26 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 17 Mar 2003 01:26:15 +0000 (01:26 +0000)
engines/openbox/theme.c

index 76207826832889455e9bdacc230013e93aa0e605..50e548442eaa4a9afd7742ea35ebd7ce4afcb862 100644 (file)
@@ -249,6 +249,8 @@ void set_default_appearance(Appearance *a)
 gboolean load()
 {
     XrmDatabase db = NULL;
+    Justify winjust;
+    char *winjuststr;
 
     if (themerc_theme != NULL) {
        db = loaddb(themerc_theme);
@@ -272,6 +274,15 @@ gboolean load()
     s_winfont_height = font_height(s_winfont, s_winfont_shadow,
                                    s_winfont_shadow_offset);
 
+    winjust = Justify_Left;
+    if (read_string(db, "window.justify", &winjuststr)) {
+        if (!g_ascii_strcasecmp(winjuststr, "right"))
+            winjust = Justify_Right;
+        else if (!g_ascii_strcasecmp(winjuststr, "center"))
+            winjust = Justify_Center;
+        g_free(winjuststr);
+    }
+
     if (!read_int(db, "handleWidth", &s_handle_height) ||
        s_handle_height < 0 || s_handle_height > 100) s_handle_height = 6;
     if (!read_int(db, "bevelWidth", &s_bevel) ||
@@ -368,12 +379,14 @@ gboolean load()
 
     /* set up the textures */
     a_focused_label->texture[0].type = Text;
+    a_focused_label->texture[0].data.text.justify = winjust;
     a_focused_label->texture[0].data.text.font = s_winfont;
     a_focused_label->texture[0].data.text.shadow = s_winfont_shadow;
     a_focused_label->texture[0].data.text.offset = s_winfont_shadow_offset;
     a_focused_label->texture[0].data.text.color = s_title_focused_color;
 
     a_unfocused_label->texture[0].type = Text;
+    a_unfocused_label->texture[0].data.text.justify = winjust;
     a_unfocused_label->texture[0].data.text.font = s_winfont;
     a_unfocused_label->texture[0].data.text.shadow = s_winfont_shadow;
     a_unfocused_label->texture[0].data.text.offset = s_winfont_shadow_offset;
This page took 0.02316 seconds and 4 git commands to generate.