]> Dogcows Code - chaz/openbox/blobdiff - obrender/theme.c
add application opacity configuration
[chaz/openbox] / obrender / theme.c
index 5f140657b6c3564f66df6c59ab1b6156bea8fb97..b20182ad23217b148626e77202f259c4c61bfbb2 100644 (file)
@@ -259,9 +259,13 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
     READ_INT("border.width", theme->fbwidth, 0, 100, 1);
     READ_INT("menu.border.width", theme->mbwidth, 0, 100, theme->fbwidth);
     READ_INT("osd.border.width", theme->obwidth, 0, 100, theme->fbwidth);
+    READ_INT("undecorated.border.width", theme->ubwidth, 0, 100,
+             theme->fbwidth);
     READ_INT("menu.separator.width", theme->menu_sep_width, 1, 100, 1);
-    READ_INT("menu.separator.padding.width", theme->menu_sep_paddingx, 0, 100, 6);
-    READ_INT("menu.separator.padding.height", theme->menu_sep_paddingy, 0, 100, 3);
+    READ_INT("menu.separator.padding.width", theme->menu_sep_paddingx,
+             0, 100, 6);
+    READ_INT("menu.separator.padding.height", theme->menu_sep_paddingy,
+             0, 100, 3);
     READ_INT("window.client.padding.width", theme->cbwidthx, 0, 100,
              theme->paddingx);
     READ_INT("window.client.padding.height", theme->cbwidthy, 0, 100,
@@ -270,7 +274,11 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
     /* load colors */
     READ_COLOR_("window.active.border.color", "border.color",
                 theme->frame_focused_border_color, RrColorNew(inst, 0, 0, 0));
-
+    /* undecorated focused border color inherits from frame focused border
+       color */
+    READ_COLOR("window.undecorated.active.border.color",
+               theme->frame_undecorated_focused_border_color,
+               RrColorCopy(theme->frame_focused_border_color));
     /* title separator focused color inherits from focused border color */
     READ_COLOR("window.active.title.separator.color",
                theme->title_separator_focused_color,
@@ -281,6 +289,12 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
                theme->frame_unfocused_border_color,
                RrColorCopy(theme->frame_focused_border_color));
 
+    /* undecorated unfocused border color inherits from frame unfocused border
+       color */
+    READ_COLOR("window.undecorated.inactive.border.color",
+               theme->frame_undecorated_unfocused_border_color,
+               RrColorCopy(theme->frame_unfocused_border_color));
+
     /* title separator unfocused color inherits from unfocused border color */
     READ_COLOR("window.inactive.title.separator.color",
                theme->title_separator_unfocused_color,
@@ -1598,7 +1612,9 @@ void RrThemeFree(RrTheme *theme)
         RrColorFree(theme->menu_border_color);
         RrColorFree(theme->osd_border_color);
         RrColorFree(theme->frame_focused_border_color);
+        RrColorFree(theme->frame_undecorated_focused_border_color);
         RrColorFree(theme->frame_unfocused_border_color);
+        RrColorFree(theme->frame_undecorated_unfocused_border_color);
         RrColorFree(theme->title_separator_focused_color);
         RrColorFree(theme->title_separator_unfocused_color);
         RrColorFree(theme->cb_unfocused_color);
@@ -1781,6 +1797,7 @@ static gboolean read_string(XrmDatabase db, const gchar *rname, gchar **value)
 
     if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
         retvalue.addr != NULL) {
+        g_strstrip(retvalue.addr);
         *value = retvalue.addr;
         ret = TRUE;
     }
@@ -1799,7 +1816,12 @@ static gboolean read_color(XrmDatabase db, const RrInstance *inst,
 
     if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
         retvalue.addr != NULL) {
-        RrColor *c = RrColorParse(inst, retvalue.addr);
+        RrColor *c;
+
+        /* retvalue.addr is inside the xrdb database so we can't destroy it
+           but we can edit it in place, as g_strstrip does. */
+        g_strstrip(retvalue.addr);
+        c = RrColorParse(inst, retvalue.addr);
         if (c != NULL) {
             *value = c;
             ret = TRUE;
This page took 0.027364 seconds and 4 git commands to generate.