]> Dogcows Code - chaz/openbox/blobdiff - render/theme.c
give different border colors to active and inactive windows. adjust the xml theme...
[chaz/openbox] / render / theme.c
index ca8f6c1de7e5e74a2f0f01b309b39d7892df808b..1dd49caf4a3462d846d36d2f756336376a69d7a9 100644 (file)
@@ -196,31 +196,40 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
               &theme->paddingx, &theme->paddingy, 0, 100, 0, 100))
         theme->paddingx = theme->paddingy = 3;
 
-    if (!FIND(int, L("window","border","width"),
+    if (!FIND(int, L("dimensions","window","border"),
               &theme->fbwidth, 0, 100))
         theme->fbwidth = 1;
 
     /* menu border width inherits from frame border width */
-    if (!FIND(int, L("menu","border","width"),
+    if (!FIND(int, L("dimensions","menu","border"),
               &theme->mbwidth, 0, 100))
         theme->mbwidth = theme->fbwidth;
 
-    if (!FIND(point, L("window","clientpadding"), &theme->cbwidthx,
-              &theme->cbwidthy, 0, 100, 0, 100))
+    if (!FIND(point, L("dimensions","window","clientpadding"),
+              &theme->cbwidthx, &theme->cbwidthy, 0, 100, 0, 100))
         theme->cbwidthx = theme->cbwidthy = 1;
 
     /* load colors */
-    if (!FIND(color, L("window","border","primary"),
-              &theme->frame_b_color, NULL))
-        theme->frame_b_color = RrColorNew(inst, 0, 0, 0);
-
-    /* menu border color inherits from frame border color */
-    if (!FIND(color, L("menu","border","primary"),
-              &theme->menu_b_color, NULL))
-        theme->menu_b_color = RrColorNew(inst,
-                                         theme->frame_b_color->r,
-                                         theme->frame_b_color->g,
-                                         theme->frame_b_color->b);
+    if (!FIND(color, L("window","active","border"),
+              &theme->frame_focused_border_color, NULL))
+        theme->frame_focused_border_color = RrColorNew(inst, 0, 0, 0);
+    /* frame unfocused border color inherits from frame focused border color */
+    if (!FIND(color, L("window","inactive","border"),
+              &theme->frame_unfocused_border_color, NULL))
+        theme->frame_unfocused_border_color =
+            RrColorNew(inst,
+                       theme->frame_focused_border_color->r,
+                       theme->frame_focused_border_color->g,
+                       theme->frame_focused_border_color->b);
+
+    /* menu border color inherits from frame focused border color */
+    if (!FIND(color, L("menu","border"),
+              &theme->menu_border_color, NULL))
+        theme->menu_border_color =
+            RrColorNew(inst,
+                       theme->frame_focused_border_color->r,
+                       theme->frame_focused_border_color->g,
+                       theme->frame_focused_border_color->b);
     if (!FIND(color, L("window","active","clientpadding"),
               &theme->cb_focused_color, NULL))
         theme->cb_focused_color = RrColorNew(inst, 255, 255, 255);
@@ -425,7 +434,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         if (!read_mask(&ps, "max_toggled_pressed.xbm",
                        &theme->max_toggled_pressed_mask))
             theme->max_toggled_pressed_mask =
-                RrPixmapMaskCopy(theme->max_pressed_mask);
+                RrPixmapMaskCopy(theme->max_toggled_mask);
         if (!read_mask(&ps, "max_toggled_hover.xbm",
                        &theme->max_toggled_hover_mask))
             theme->max_toggled_hover_mask =
@@ -447,7 +456,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         theme->max_disabled_mask = RrPixmapMaskCopy(theme->max_mask);
         theme->max_hover_mask = RrPixmapMaskCopy(theme->max_mask);
         theme->max_toggled_pressed_mask =
-            RrPixmapMaskCopy(theme->max_pressed_mask);
+            RrPixmapMaskCopy(theme->max_toggled_mask);
         theme->max_toggled_hover_mask =
             RrPixmapMaskCopy(theme->max_toggled_mask);
     }
@@ -486,7 +495,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         if (!read_mask(&ps, "desk_toggled_pressed.xbm",
                        &theme->desk_toggled_pressed_mask))
             theme->desk_toggled_pressed_mask =
-                RrPixmapMaskCopy(theme->desk_pressed_mask);
+                RrPixmapMaskCopy(theme->desk_toggled_mask);
         if (!read_mask(&ps, "desk_toggled_hover.xbm",
                        &theme->desk_toggled_hover_mask))
             theme->desk_toggled_hover_mask =
@@ -509,7 +518,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         theme->desk_disabled_mask = RrPixmapMaskCopy(theme->desk_mask);
         theme->desk_hover_mask = RrPixmapMaskCopy(theme->desk_mask);
         theme->desk_toggled_pressed_mask =
-            RrPixmapMaskCopy(theme->desk_pressed_mask);
+            RrPixmapMaskCopy(theme->desk_toggled_mask);
         theme->desk_toggled_hover_mask =
             RrPixmapMaskCopy(theme->desk_toggled_mask);
     }
@@ -523,7 +532,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         if (!read_mask(&ps, "shade_toggled_pressed.xbm",
                        &theme->shade_toggled_pressed_mask))
             theme->shade_toggled_pressed_mask =
-                RrPixmapMaskCopy(theme->shade_pressed_mask);
+                RrPixmapMaskCopy(theme->shade_toggled_mask);
         if (!read_mask(&ps, "shade_toggled_hover.xbm",
                        &theme->shade_toggled_hover_mask))
             theme->shade_toggled_hover_mask =
@@ -546,7 +555,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         theme->shade_disabled_mask = RrPixmapMaskCopy(theme->shade_mask);
         theme->shade_hover_mask = RrPixmapMaskCopy(theme->shade_mask);
         theme->shade_toggled_pressed_mask =
-            RrPixmapMaskCopy(theme->shade_pressed_mask);
+            RrPixmapMaskCopy(theme->shade_toggled_mask);
         theme->shade_toggled_hover_mask =
             RrPixmapMaskCopy(theme->shade_toggled_mask);
     }
@@ -1191,6 +1200,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
         RrMargins(theme->a_focused_label, &fl, &ft, &fr, &fb);
         RrMargins(theme->a_unfocused_label, &ul, &ut, &ur, &ub);
         theme->label_height = theme->win_font_height + MAX(ft + fb, ut + ub);
+        theme->label_height += theme->label_height % 2;
 
         /* this would be nice I think, since padding.width can now be 0,
            but it breaks frame.c horribly and I don't feel like fixing that
@@ -1219,8 +1229,9 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
 void RrThemeFree(RrTheme *theme)
 {
     if (theme) {
-        RrColorFree(theme->menu_b_color);
-        RrColorFree(theme->frame_b_color);
+        RrColorFree(theme->menu_border_color);
+        RrColorFree(theme->frame_focused_border_color);
+        RrColorFree(theme->frame_unfocused_border_color);
         RrColorFree(theme->cb_unfocused_color);
         RrColorFree(theme->cb_focused_color);
         RrColorFree(theme->title_focused_color);
This page took 0.031129 seconds and 4 git commands to generate.