changeset 3269:976c4f4c4c51

Fixed style inheritance of tray, panel_top and panel_bottom
author unexist
date Tue, 26 Dec 2017 15:22:44 +0100
parents 63b83837ae1b
children 67a7ad766b4f
files src/subtle/ruby.c src/subtle/screen.c src/subtle/style.c
diffstat 3 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/ruby.c	Tue Dec 26 15:21:55 2017 +0100
+++ b/src/subtle/ruby.c	Tue Dec 26 15:22:44 2017 +0100
@@ -3585,9 +3585,9 @@
   subStyleReset(&subtle->styles.sublets,   -1);
   subStyleReset(&subtle->styles.separator, -1);
   subStyleReset(&subtle->styles.clients,    0);
-  subStyleReset(&subtle->styles.panel_top,  0);
-  subStyleReset(&subtle->styles.panel_bot,  0);
-  subStyleReset(&subtle->styles.tray,       0);
+  subStyleReset(&subtle->styles.panel_top, -1);
+  subStyleReset(&subtle->styles.panel_bot, -1);
+  subStyleReset(&subtle->styles.tray,      -1);
 
   /* Reset values */
   subtle->gravity           = -1;
--- a/src/subtle/screen.c	Tue Dec 26 15:21:55 2017 +0100
+++ b/src/subtle/screen.c	Tue Dec 26 15:22:44 2017 +0100
@@ -516,12 +516,18 @@
             {
               if(0 < subtle->trays->ndata)
                 {
+                  int tray_width  = p->width - STYLE_WIDTH(subtle->styles.tray);
+                  int tray_height = subtle->ph - STYLE_HEIGHT(subtle->styles.tray);
+
                   XMapRaised(subtle->dpy, subtle->windows.tray);
+
+                  XSetForeground(subtle->dpy, subtle->gcs.draw, subtle->styles.tray.bg);
+                  XFillRectangle(subtle->dpy, subtle->windows.tray, subtle->gcs.draw,
+                      0,0, tray_width, tray_height);
+
                   XMoveResizeWindow(subtle->dpy, subtle->windows.tray, 
                     x[offset] + STYLE_LEFT(subtle->styles.tray),
-                    STYLE_TOP(subtle->styles.tray),
-                    p->width - STYLE_WIDTH(subtle->styles.tray),
-                    subtle->ph - STYLE_HEIGHT(subtle->styles.tray));
+                    STYLE_TOP(subtle->styles.tray), tray_width, tray_height);
                 }
             }
 
--- a/src/subtle/style.c	Tue Dec 26 15:21:55 2017 +0100
+++ b/src/subtle/style.c	Tue Dec 26 15:22:44 2017 +0100
@@ -293,6 +293,9 @@
   StyleInherit(&subtle->styles.title,     &subtle->styles.all);
   StyleInherit(&subtle->styles.sublets,   &subtle->styles.all);
   StyleInherit(&subtle->styles.separator, &subtle->styles.all);
+  StyleInherit(&subtle->styles.panel_top, &subtle->styles.all);
+  StyleInherit(&subtle->styles.panel_bot, &subtle->styles.all);
+  StyleInherit(&subtle->styles.tray,      &subtle->styles.all);
 
   /* Check font */
   StyleFont(&(subtle->styles.title),     "title");
@@ -300,8 +303,8 @@
   StyleFont(&(subtle->styles.sublets),   "sublets");
   StyleFont(subtle->styles.occupied,     "occupied");
   StyleFont(subtle->styles.focus,        "focus");
-  StyleFont(subtle->styles.view_sep,      "view separator");
-  StyleFont(subtle->styles.sublet_sep,    "sublet separator");
+  StyleFont(subtle->styles.view_sep,     "view separator");
+  StyleFont(subtle->styles.sublet_sep,   "sublet separator");
 
   subSubtleLogDebugSubtle("Update\n");
 } /* }}} */