]> Dogcows Code - chaz/openbox/commitdiff
move the titlebar layout from the theme to the rc file
authorDana Jansens <danakj@orodu.net>
Wed, 30 Jul 2003 16:25:08 +0000 (16:25 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 30 Jul 2003 16:25:08 +0000 (16:25 +0000)
data/rc3
openbox/config.c
openbox/config.h
openbox/frame.c
render/theme.c
render/theme.h

index a7a7b1482cf84dd0a5a3feefcd138214a4758a3e..9acb3bb5d08f2b97d9f33e3000f1c7176a2d4454 100644 (file)
--- a/data/rc3
+++ b/data/rc3
@@ -25,6 +25,7 @@
 
 <theme>
   <theme>operation</theme>
+  <titlelayout>NLIMC</titlelayout>
 </theme>
 
 <desktops>
index 5089a335f5576d5434ddd0a90a0a5830e837012a..d9c9789e309e91984ab327e9cabbfed7f59bb53c 100644 (file)
@@ -9,6 +9,8 @@ gboolean config_focus_popup;
 
 char *config_theme;
 
+gchar *config_title_layout;
+
 int     config_desktops_num;
 GSList *config_desktops_names;
 
@@ -52,6 +54,10 @@ static void parse_theme(xmlDocPtr doc, xmlNodePtr node, void *d)
         g_free(config_theme);
         config_theme = parse_string(doc, n);
     }
+    if ((n = parse_find_node("titlelayout", node))) {
+        g_free(config_title_layout);
+        config_title_layout = parse_string(doc, n);
+    }
 }
 
 static void parse_desktops(xmlDocPtr doc, xmlNodePtr node, void *d)
@@ -164,6 +170,8 @@ void config_startup()
 
     config_theme = NULL;
 
+    config_title_layout = g_strdup("NLIMC");
+
     parse_register("theme", parse_theme, NULL);
 
     config_desktops_num = 4;
index 79f8432c0c498ec69521d6ce760f1ddd7ff21477..0c317dac48fe023d545eb1fc01a23ed55ce33d5f 100644 (file)
@@ -47,6 +47,9 @@ extern guint config_dock_hide_timeout;
 /* The name of the theme */
 char *config_theme;
 
+/* Titlebar button layout */
+gchar *config_title_layout;
+
 /*! The number of desktops */
 extern int config_desktops_num;
 /*! Names for the desktops */
index 05ac3c711535ffda022b467dc0c2107fd00ebb6b..a66bef93b2106c2cf3dd9e70d3b3fcd85ef8ad9d 100644 (file)
@@ -2,6 +2,7 @@
 #include "client.h"
 #include "openbox.h"
 #include "extensions.h"
+#include "config.h"
 #include "framerender.h"
 #include "render/theme.h"
 
@@ -429,7 +430,7 @@ static void layout_title(ObFrame *self)
 
     /* figure out whats being shown, and the width of the label */
     self->label_width = self->width - (ob_rr_theme->bevel + 1) * 2;
-    for (lc = ob_rr_theme->title_layout; *lc != '\0'; ++lc) {
+    for (lc = config_title_layout; *lc != '\0'; ++lc) {
        switch (*lc) {
        case 'N':
             if (n) { *lc = ' '; break; } /* rm duplicates */
@@ -487,7 +488,7 @@ static void layout_title(ObFrame *self)
     if (!c) XUnmapWindow(ob_display, self->close);
 
     x = ob_rr_theme->bevel + 1;
-    for (lc = ob_rr_theme->title_layout; *lc != '\0'; ++lc) {
+    for (lc = config_title_layout; *lc != '\0'; ++lc) {
        switch (*lc) {
        case 'N':
            if (!n) break;
index b9172b69719f456a5fd1107ff72663bd8d72fc0a..cfbc5f9ce868f850c7dabe4477d25e996296a071 100644 (file)
@@ -133,11 +133,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
             mjust = RR_JUSTIFY_CENTER;
     }
 
-    /* load the title layout */
-    if (!read_string(db, "window.title.layout", &font_str))
-        font_str = "NLIMC";
-    theme->title_layout = g_strdup(font_str);
-
     /* load direct dimensions */
     if (!read_int(db, "menuOverlap", &theme->menu_overlap) ||
        theme->menu_overlap < 0 || theme->menu_overlap > 20)
@@ -732,8 +727,6 @@ void RrThemeFree(RrTheme *theme)
         RrFontClose(theme->mtitlefont);
         RrFontClose(theme->mfont);
 
-        g_free(theme->title_layout);
-
         RrAppearanceFree(theme->a_disabled_focused_max);
         RrAppearanceFree(theme->a_disabled_unfocused_max);
         RrAppearanceFree(theme->a_hover_focused_max);
index f7c0dc67dde4536989e3c8f267cf295c96396947..5abe35ea7f7cfc6bde9b521db043ab3176622dad 100644 (file)
@@ -49,9 +49,6 @@ struct _RrTheme {
     gint mfont_height;
     RrFont *mfont;
 
-    /* style settings - title layout */
-    gchar *title_layout;
-
     /* style settings - masks */
     RrPixmapMask *max_set_mask;
     RrPixmapMask *max_unset_mask;
This page took 0.037359 seconds and 4 git commands to generate.