Re: [Sawfish] 2 new blue styles for StyleTab

[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]


Hi,

On Fri, 7 Oct 2011 20:21:43 +0200
wrote fuchur <flohtransporter@xxxxxxxxx>:

>The patch remove-adjust-title.patch remove
>"window-state-change-hook title-position" from tabgroup.jl and
>frames.jl (the last StylTab need this anymore). 
>
>Some Styles are rename. Now we have Default -> Dark/Darkolor,
>Glass -> Blue/Bluedarker, WixDa -> Silver/Silvercolor, Reduce and
>Smoothly. I have add corners (size = frame width) to the shaped-frame
>and shaped-transient-frame titlebar for resize with mouse. 
>Styles download here:
>https://sites.google.com/site/flohtransporter/files/styles.07.10.11.tar.bz2
>
>All patches are for the theming-branch.

Please don't use the patch "theme.jl-07.10.11.patch", use the patch by 
this mail (theme.jl-07.10.11.01.patch). Add a fix for
shaped/shaped-transient shaded frames.

-- 
Regards,
Fuchur

GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
--- theme.jl.orgi	2011-10-07 18:51:28.000000000 +0200
+++ theme.jl	2011-10-07 21:56:59.000000000 +0200
@@ -30,8 +30,7 @@
 (defcustom styletab-c:styles 'Default "Frame and button style."
   :group (appearance StyleTab:group)
   :type symbol
-  :options (Default))
-;;  :options (Default Reduce Glass WixDa Smoothly)
+  :options (Default Reduce Glass WixDa Smoothly))
 
 (defcustom styletab-c:titlebar-place 'top "Titlebar default place."
   :group (appearance StyleTab:group)
@@ -61,7 +60,7 @@
 (defcustom styletab-c:proposals 'Pink "Proposals."
   :group (appearance StyleTab:group StyleTab:color-group)
   :type symbol
-  :options (Brown Dark Darkblue Blue Pink Green)
+  :options (Default Reduce Glass WixDa Smoothly Brown Darkblue Blue Pink Green)
   :after-set (lambda () (color-changed)))
 
 (defcustom styletab-c:hightlight-tabbar nil "Also hightlighted tabbars."
@@ -327,7 +326,11 @@
   (lambda ()
     (case styletab-c:proposals
           ;; format "color" "dimout inactive frame" "brighte mouse over button active" "brighte mouse over button inactive"
-          ((Dark) (list "#000033" '40 '100 '100))
+          ((Default) (list "#000033" '40 '100 '100))
+          ((Reduce) (list "#000000" '0 '100 '100))
+          ((Glass) (list "#5E5E70" '60 '40 '60))
+          ((WixDa) (list "#6E6D8F" '20 '40 '60))
+          ((Smoothly) (list "#75759E" '20 '40 '40))
           ((Darkblue) (list "#00006E" '30 '70 '70))
           ((Brown) (list "#780000" '40 '40 '50))
           ((Blue) (list "#0000B4" '30 '40 '50))
@@ -355,18 +358,18 @@
 
 (define title-colors-glass
   (lambda ()
-    `((focused . "#E5E5E5") (highlighted . "#FDFDFD") (clicked . "#FDFDFD") (inactive . "#2B2B2B") (inactive-highlighted . "#000000")
-      (inactive-clicked . "#000000"))))
+    `((focused . "#F2F2F2") (highlighted . "#FFFFFF") (clicked . "#FFFFFF") (inactive . "#D9D9D9") (inactive-highlighted . "#E6E6E6")
+      (inactive-clicked . "#E6E6E6"))))
 
 (define title-colors-wixda
   (lambda ()
-    `((focused . "#000000") (highlighted . "#333333") (clicked . "#333333") (inactive . "#4C4C4C") (inactive-highlighted . "#666666")
-      (inactive-clicked . "#666666"))))
+    `((focused . "#262626") (highlighted . "#000000") (clicked . "#000000") (inactive . "#404040") (inactive-highlighted . "#333333")
+      (inactive-clicked . "#333333"))))
 
 (define title-colors-smoothly
   (lambda ()
-    `((focused . "#000000") (highlighted . "#333333") (clicked . "#333333") (inactive . "#666666") (inactive-highlighted . "#777777")
-      (inactive-clicked . "#777777"))))
+    `((focused . "#333333") (highlighted . "#000000") (clicked . "#000000") (inactive . "#666666") (inactive-highlighted . "#444444")
+      (inactive-clicked . "#444444"))))
 
 (define button-width-custom
   (lambda ()
@@ -412,20 +415,20 @@
 (define button-left-edge
   (lambda ()
     (case styletab-c:styles
-          ((Default) 1)
-          ((Reduce) 1)
-          ((Glass) 1)
-          ((WixDa) 1)
-          ((Smoothly) 1))))
+          ((Default) 0)
+          ((Reduce) 0)
+          ((Glass) 0)
+          ((WixDa) 0)
+          ((Smoothly) 0))))
 
 (define button-right-edge
   (lambda ()
     (case styletab-c:styles
-          ((Default) 2)
-          ((Reduce) 2)
-          ((Glass) 1)
-          ((WixDa) 1)
-          ((Smoothly) 3))))
+          ((Default) 1)
+          ((Reduce) 1)
+          ((Glass) 0)
+          ((WixDa) 0)
+          ((Smoothly) 2))))
 
 (define icon-edge
   (lambda ()
@@ -719,17 +722,17 @@
 ;;; make images/recolor 
 
 ;; button/icon table
-(define styletab-icon-cache (make-weak-table eq-hash eq))
+(define styletab-c-icon-cache (make-weak-table eq-hash eq))
 
 ;; frames/title table
-(define styletab-frame-cache (make-table equal-hash equal))
+(define styletab-c-frame-cache (make-table equal-hash equal))
 
 (define (window-icon w)
-  (or (table-ref styletab-icon-cache w)
+  (or (table-ref styletab-c-icon-cache w)
       (let ((icon (window-icon-image w)))
         (if icon
             (let ((scaled (scale-image icon (- styletab-c:title-dimension 7) (- styletab-c:title-dimension 7))))
-              (table-set styletab-icon-cache w scaled)
+              (table-set styletab-c-icon-cache w scaled)
               scaled)
           (scale-image top-frame-icon-title-images (- styletab-c:title-dimension 7) (- styletab-c:title-dimension 7))))))
 
@@ -769,76 +772,78 @@
     (recolorer img)
     img))
 
-(define recolor-lock t)
-(define recolor-cache t)
-
-(define (do-make-image-cache img)
+(define (do-make-get-image img)
   (or
-   (table-ref styletab-frame-cache img)
+   (table-ref styletab-c-frame-cache img)
    (let ((image
           (make-image img)))
-     (table-set styletab-frame-cache img image))))
+     (table-set styletab-c-frame-cache img image)
+     image)))
 
-(define (get-cached-image img)
-  (table-ref styletab-frame-cache img))
 
 (define (base-tables-images w)
-  (or
-   (table-ref styletab-frame-cache w)
-   (progn  
-     (when (not recolor-cache)
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-f.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-i.png")))
-     (when recolor-cache
-       (let ((focus (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-f.png"))
-                                (if (eq styletab-c:custom-frame-colors t)
-                                    (get-recolor-dark 0 styletab-c:focus-frame-color)
-                                  (get-recolor-dark 0 (get-color (nth 0 (proposals-colors)))))))
-             (inact (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-i.png"))
-                                (if (eq styletab-c:custom-frame-colors t)
-                                    (get-recolor-dark (* styletab-c:inactive-dimout 20) styletab-c:unfocus-frame-color)
-                                  (get-recolor-dark (nth 1 (proposals-colors)) (get-color (nth 0 (proposals-colors))))))))
-         (table-set styletab-frame-cache w `((focused . ,focus) (inactive .. ,inact))))))))
+  (let ((focus (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-f.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-dark 0 styletab-c:focus-frame-color)
+                             (get-recolor-dark 0 (get-color (nth 0 (proposals-colors)))))))
+        (inact (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-i.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-dark (* styletab-c:inactive-dimout 20) styletab-c:unfocus-frame-color)
+                             (get-recolor-dark (nth 1 (proposals-colors)) (get-color (nth 0 (proposals-colors))))))))
+    (table-unset styletab-c-frame-cache w)
+    (table-set styletab-c-frame-cache w `((focused . ,focus) (inactive . ,inact)))))
 
 (define (tab-tables-images w)
-  (or
-   (table-ref styletab-frame-cache w)
-   (progn  
-     (when (not recolor-cache)
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-f.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-h.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-i.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-ih.png")))
-     (when recolor-cache
-       (let ((focus (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-f.png"))
-                                (if (eq styletab-c:custom-frame-colors t)
-                                    (get-recolor-dark 0 styletab-c:focus-frame-color)
-                                  (get-recolor-dark 0 (get-color (nth 0 (proposals-colors)))))))
-             (highl (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-h.png"))
-                                (if (eq styletab-c:custom-frame-colors t)
-                                    (get-recolor-bright 
-                                     (if (eq styletab-c:hightlight-tabbar t) 
-                                         (/ (* styletab-c:active-hightlight-brighten 20) 2) 0)
-                                     styletab-c:focus-frame-color) (get-recolor-bright 
-                                                                    (if (eq styletab-c:hightlight-tabbar t) 
-                                                                        (/ (nth 2 (proposals-colors)) 2) 0)
-                                                                    (get-color (nth 0 (proposals-colors)))))))
-             (inact (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-i.png"))
-                                (if (eq styletab-c:custom-frame-colors t)
-                                    (get-recolor-dark (* styletab-c:inactive-dimout 20) styletab-c:unfocus-frame-color)
-                                  (get-recolor-dark (nth 1 (proposals-colors)) (get-color (nth 0 (proposals-colors)))))))
-             (in-hi (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-ih.png"))
-                                (if (eq styletab-c:custom-frame-colors t)
-                                    (get-recolor-bright 
-                                     (if (eq styletab-c:hightlight-tabbar t) 
-                                         (- (/ (* styletab-c:inactive-hightlight-brighten 20) 2) (* styletab-c:inactive-dimout 20))
-                                       (- (* styletab-c:inactive-dimout 20)))
-                                     styletab-c:unfocus-frame-color)
-                                  (get-recolor-bright (if (eq styletab-c:hightlight-tabbar t) 
-                                                          (- (/ (nth 3 (proposals-colors)) 2) (nth 1 (proposals-colors)))
-                                                        (- (nth 1 (proposals-colors))))
-                                                      (get-color (nth 0 (proposals-colors))))))))
-         (table-set styletab-frame-cache w `((focused . ,focus) (highlighted . ,highl) (inactive . ,inact) (inactive-highlighted . ,in-hi))))))))
+  (let ((focus (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-f.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-dark 0 styletab-c:focus-frame-color)
+                             (get-recolor-dark 0 (get-color (nth 0 (proposals-colors)))))))
+        (highl (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-h.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-bright 
+                                (if (eq styletab-c:hightlight-tabbar t) 
+                                    (/ (* styletab-c:active-hightlight-brighten 20) 2) 0)
+                                styletab-c:focus-frame-color) (get-recolor-bright 
+                                                               (if (eq styletab-c:hightlight-tabbar t) 
+                                                                   (/ (nth 2 (proposals-colors)) 2) 0)
+                                                               (get-color (nth 0 (proposals-colors)))))))
+        (inact (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-i.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-dark (* styletab-c:inactive-dimout 20) styletab-c:unfocus-frame-color)
+                             (get-recolor-dark (nth 1 (proposals-colors)) (get-color (nth 0 (proposals-colors)))))))
+        (in-hi (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-ih.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-bright 
+                                (if (eq styletab-c:hightlight-tabbar t) 
+                                    (- (/ (* styletab-c:inactive-hightlight-brighten 20) 2) (* styletab-c:inactive-dimout 20))
+                                  (- (* styletab-c:inactive-dimout 20)))
+                                styletab-c:unfocus-frame-color)
+                             (get-recolor-bright (if (eq styletab-c:hightlight-tabbar t) 
+                                                     (- (/ (nth 3 (proposals-colors)) 2) (nth 1 (proposals-colors)))
+                                                   (- (nth 1 (proposals-colors))))
+                                                 (get-color (nth 0 (proposals-colors))))))))
+    (table-unset styletab-c-frame-cache w)
+    (table-set styletab-c-frame-cache w `((focused . ,focus) (highlighted .. ,highl) (inactive . ,inact) (inactive-highlighted . ,in-hi)))))
+
+(define (base-button-tables-images w)
+  (let ((focus (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-f.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-dark 0 styletab-c:focus-frame-color)
+                             (get-recolor-dark 0 (get-color (nth 0 (proposals-colors)))))))
+        (in-cl (do-recolor (do-make-get-image  (concat (symbol-name styletab-c:styles) "/" w "-c.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-dark (* styletab-c:inactive-dimout 20) styletab-c:unfocus-frame-color)
+                             (get-recolor-dark (nth 1 (proposals-colors)) (get-color (nth 0 (proposals-colors)))))))
+        (click (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-c.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-dark 0 styletab-c:focus-frame-color)
+                             (get-recolor-dark 0 (get-color (nth 0 (proposals-colors)))))))
+        (inact (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-i.png"))
+                           (if (eq styletab-c:custom-frame-colors t)
+                               (get-recolor-dark (* styletab-c:inactive-dimout 20) styletab-c:unfocus-frame-color)
+                             (get-recolor-dark (nth 1 (proposals-colors)) (get-color (nth 0 (proposals-colors))))))))
+    (table-unset styletab-c-frame-cache w)
+    (table-set styletab-c-frame-cache w  `((focused . ,focus) (clicked . ,click) (inactive . ,inact) (inactive-clicked . ,in-cl)))))
 
 (define scale-w nil)
 (define scale-h nil)
@@ -849,177 +854,135 @@
              (setq scale-h (- styletab-c:title-dimension 4)))
     (progn (setq scale-w (- styletab-c:title-dimension 4))
            (setq scale-h (+ styletab-c:title-dimension (button-width-custom)))))
-  (or
-   (table-ref styletab-frame-cache (concat w "-frame-" x "-button"))
-   (progn  
-     (when (not recolor-cache)
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-f.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-h.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-c.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-i.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-ih.png"))
-       (do-make-image-cache (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-ic.png")))
-     (when recolor-cache
-
-       (let ((focus (scale-image (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-f.png"))
-                                             (if (eq styletab-c:custom-frame-colors t)
-                                                 (get-recolor-dark 0 (if (and always color) color styletab-c:focus-frame-color))
-                                               (get-recolor-dark 0 (if (and always color) color (get-color (nth 0 (proposals-colors))))))) 
-                                 scale-w scale-h))
-             (highl (scale-image (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-h.png"))
-                                             (if (eq styletab-c:custom-frame-colors t)
-                                                 (get-recolor-bright (* styletab-c:active-hightlight-brighten 20)
-                                                                     (if color color styletab-c:focus-frame-color))
-                                               (get-recolor-bright (nth 2 (proposals-colors))
-                                                                   (if color color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
-             (click (scale-image (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-c.png"))
-                                             (if (eq styletab-c:custom-frame-colors t)
-                                                 (get-recolor-bright (* styletab-c:active-hightlight-brighten 20)
-                                                                     (if color color styletab-c:focus-frame-color))
-                                               (get-recolor-bright (nth 2 (proposals-colors))
-                                                                   (if color color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
-             (inact (scale-image (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-i.png"))
-                                             (if (eq styletab-c:custom-frame-colors t)
-                                                 (get-recolor-dark (* styletab-c:inactive-dimout 20)
-                                                                   (if (and always color) color styletab-c:unfocus-frame-color))
-                                               (get-recolor-dark (nth 1 (proposals-colors))
-                                                                 (if (and always color) color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
-             (in-hi (scale-image (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-ih.png"))
-                                             (if (eq styletab-c:custom-frame-colors t)
-                                                 (get-recolor-bright (- (* styletab-c:inactive-hightlight-brighten 20) (* styletab-c:inactive-dimout 20))
-                                                                     (if color color styletab-c:unfocus-frame-color))
-                                               (get-recolor-bright (- (nth 3 (proposals-colors)) (nth 1 (proposals-colors)))
-                                                                   (if color color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
-             (in-cl (scale-image (do-recolor (get-cached-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-ic.png"))
-                                             (if (eq styletab-c:custom-frame-colors t)
-                                                 (get-recolor-bright (- (* styletab-c:inactive-hightlight-brighten 20) (* styletab-c:inactive-dimout 20))
-                                                                     (if color color styletab-c:unfocus-frame-color))
-                                               (get-recolor-bright (- (nth 3 (proposals-colors)) (nth 1 (proposals-colors)))
-                                                                   (if color color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h)))
-         (table-set styletab-frame-cache (concat w "-frame-" x "-button") `((focused . ,focus) (highlighted . ,highl) (clicked . ,click) 
-                                                                              (inactive . ,inact) (inactive-highlighted . ,in-hi) 
-                                                                              (inactive-clicked . ,in-cl))))))))
+  (let ((focus (scale-image (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-f.png"))
+                                        (if (eq styletab-c:custom-frame-colors t)
+                                            (get-recolor-dark 0 (if (and always color) color styletab-c:focus-frame-color))
+                                          (get-recolor-dark 0 (if (and always color) color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
+        (highl (scale-image (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-h.png"))
+                                        (if (eq styletab-c:custom-frame-colors t)
+                                            (get-recolor-bright (* styletab-c:active-hightlight-brighten 20)
+                                                                (if color color styletab-c:focus-frame-color))
+                                          (get-recolor-bright (nth 2 (proposals-colors))
+                                                              (if color color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
+        (click (scale-image (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-c.png"))
+                                        (if (eq styletab-c:custom-frame-colors t)
+                                            (get-recolor-bright (* styletab-c:active-hightlight-brighten 20)
+                                                                (if color color styletab-c:focus-frame-color))
+                                          (get-recolor-bright (nth 2 (proposals-colors))
+                                                              (if color color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
+        (inact (scale-image (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-i.png"))
+                                        (if (eq styletab-c:custom-frame-colors t)
+                                            (get-recolor-dark (* styletab-c:inactive-dimout 20)
+                                                              (if (and always color) color styletab-c:unfocus-frame-color))
+                                          (get-recolor-dark (nth 1 (proposals-colors))
+                                                            (if (and always color) color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
+        (in-hi (scale-image (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-ih.png"))
+                                        (if (eq styletab-c:custom-frame-colors t)
+                                            (get-recolor-bright (- (* styletab-c:inactive-hightlight-brighten 20) (* styletab-c:inactive-dimout 20))
+                                                                (if color color styletab-c:unfocus-frame-color))
+                                          (get-recolor-bright (- (nth 3 (proposals-colors)) (nth 1 (proposals-colors)))
+                                                              (if color color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h))
+        (in-cl (scale-image (do-recolor (do-make-get-image (concat (symbol-name styletab-c:styles) "/" w "-frame-" x "-button-ic.png"))
+                                        (if (eq styletab-c:custom-frame-colors t)
+                                            (get-recolor-bright (- (* styletab-c:inactive-hightlight-brighten 20) (* styletab-c:inactive-dimout 20))
+                                                                (if color color styletab-c:unfocus-frame-color))
+                                          (get-recolor-bright (- (nth 3 (proposals-colors)) (nth 1 (proposals-colors)))
+                                                              (if color color (get-color (nth 0 (proposals-colors))))))) scale-w scale-h)))
+    (table-unset styletab-c-frame-cache w)
+    (table-set styletab-c-frame-cache (concat w "-frame-" x "-button") `((focused . ,focus) (highlighted . ,highl) (clicked . ,click) (inactive . ,inact)
+                                                                         (inactive-highlighted . ,in-hi) (inactive-clicked . ,in-cl)))))
 
 ;; frames/tabbar
 (define top-frame-icon-title-images
   (make-image (concat (symbol-name styletab-c:styles) "/" "top-frame-icon-title-images-f.png")))
+
 (define (tabbar-horizontal-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-" w)))
+  (mapcar (lambda (w) (mapcar (lambda (x)
                                 (tab-tables-images (concat x "-" w))) (list "top" "bottom"))) (list "frame-tab-left-icon" "frame-tab" "frame-tab-right")))
 (define (tabbar-vertical-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-" w)))
+  (mapcar (lambda (w) (mapcar (lambda (x)
                                 (tab-tables-images (concat x "-" w))) (list "left" "right"))) (list "frame-tab-top" "frame-tab" "frame-tab-bottom-icon")))
 (define (title-cursor-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-title-cursor")))
-            (base-tables-images (concat w "-frame-title-cursor"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-title-cursor"))) (list "top" "bottom" "left" "right")))
 (define (title-nocursor-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-title-nocursor"))) 
-            (base-tables-images (concat w "-frame-title-nocursor"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-title-nocursor"))) (list "top" "bottom" "left" "right")))
 (define (top-border-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-top-border")))
-            (base-tables-images (concat w "-frame-top-border"))) (list "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-top-border"))) (list "bottom" "left" "right")))
 (define (top-left-corner-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-top-left-corner"))) 
-            (base-tables-images (concat w "-frame-top-left-corner"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-top-left-corner"))) (list "top" "bottom" "left" "right")))
 (define (top-right-corner-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-top-right-corner"))) 
-            (base-tables-images (concat w "-frame-top-right-corner"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-top-right-corner"))) (list "top" "bottom" "left" "right")))
 (define (top-left-corner-shaped-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-top-left-corner-shaped"))) 
-            (base-tables-images (concat w "-frame-top-left-corner-shaped"))) (list "top" "left")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-top-left-corner-shaped"))) (list "top" "left")))
 (define (top-right-corner-shaped-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-top-right-corner-shaped")))
-            (base-tables-images (concat w "-frame-top-right-corner-shaped"))) (list "top" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-top-right-corner-shaped"))) (list "top" "right")))
 (define (title-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-title")))
-            (base-tables-images (concat w "-frame-title"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-title"))) (list "top" "bottom" "left" "right")))
 (define (left-border-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-left-border"))) 
-            (base-tables-images (concat w "-frame-left-border"))) (list "top" "bottom" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-left-border"))) (list "top" "bottom" "right")))
 (define (right-border-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-right-border")))
-            (base-tables-images (concat w "-frame-right-border"))) (list "top" "bottom" "left")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-right-border"))) (list "top" "bottom" "left")))
 (define (bottom-left-corner-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-bottom-left-corner")))
-            (base-tables-images (concat w "-frame-bottom-left-corner"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-bottom-left-corner"))) (list "top" "bottom" "left" "right")))
 (define (bottom-border-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-bottom-border")))
-            (base-tables-images (concat w "-frame-bottom-border"))) (list "top" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-bottom-border"))) (list "top" "left" "right")))
 (define (bottom-right-corner-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-bottom-right-corner")))
-            (base-tables-images (concat w "-frame-bottom-right-corner"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-bottom-right-corner"))) (list "top" "bottom" "left" "right")))
 (define (bottom-left-corner-shaped-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-bottom-left-corner-shaped"))) 
-            (base-tables-images (concat w "-frame-bottom-left-corner-shaped"))) (list "bottom" "left")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-bottom-left-corner-shaped"))) (list "bottom" "left")))
 (define (bottom-right-corner-shaped-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-bottom-right-corner-shaped"))) 
-            (base-tables-images (concat w "-frame-bottom-right-corner-shaped"))) (list "bottom" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-bottom-right-corner-shaped"))) (list "bottom" "right")))
 
 ;; buttons
 (define (base-button-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-button")))
-            (base-tables-images (concat w "-frame-button"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-button-tables-images (concat w "-frame-button"))) (list "top" "bottom" "left" "right")))
 (define (space-button-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-title")))
-            (base-tables-images (concat w "-frame-title"))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (base-tables-images (concat w "-frame-title"))) (list "top" "bottom" "left" "right")))
 (define (close-button-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-close-button")))
-            (button-tables-images w "close" styletab-c:hightlight-close
-                                  (if (eq styletab-c:hightlight-close-all t) t))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (button-tables-images w "close" styletab-c:hightlight-close
+                                            (if (eq styletab-c:hightlight-close-all t) t))) (list "top" "bottom" "left" "right")))
 (define (menu-button-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-menu-button")))
-            (button-tables-images w "menu" styletab-c:hightlight-menu
-                                  (if (eq styletab-c:hightlight-menu-all t) t))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (button-tables-images w "menu" styletab-c:hightlight-menu
+                                            (if (eq styletab-c:hightlight-menu-all t) t))) (list "top" "bottom" "left" "right")))
 (define (iconify-button-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-iconify-button"))) 
-            (button-tables-images w "iconify" styletab-c:hightlight-iconify
-                                  (if (eq styletab-c:hightlight-iconify-all t) t))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (button-tables-images w "iconify" styletab-c:hightlight-iconify
+                                            (if (eq styletab-c:hightlight-iconify-all t) t))) (list "top" "bottom" "left" "right")))
 (define (move-resize-button-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-move-resize-button"))) 
-            (button-tables-images w "move-resize" styletab-c:hightlight-move-resize
-                                  (if (eq styletab-c:hightlight-move-resize-all t) t))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (button-tables-images w "move-resize" styletab-c:hightlight-move-resize
+                                            (if (eq styletab-c:hightlight-move-resize-all t) t))) (list "top" "bottom" "left" "right")))
 (define (rename-button-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-rename-button")))
-            (button-tables-images w "rename" styletab-c:hightlight-rename
-                                  (if (eq styletab-c:hightlight-rename-all t) t))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (button-tables-images w "rename" styletab-c:hightlight-rename
+                                            (if (eq styletab-c:hightlight-rename-all t) t))) (list "top" "bottom" "left" "right")))
 (define (frame-type-button-images)
-  (mapcar (lambda (w) (when recolor-cache (table-unset styletab-frame-cache (concat w "-frame-frame-type-button"))) 
-            (button-tables-images w "frame-type" styletab-c:hightlight-frame-type
-                                  (if (eq styletab-c:hightlight-frame-type-all t) t))) (list "top" "bottom" "left" "right")))
+  (mapcar (lambda (w) (button-tables-images w "frame-type" styletab-c:hightlight-frame-type
+                                            (if (eq styletab-c:hightlight-frame-type-all t) t))) (list "top" "bottom" "left" "right")))
 (define (maximize-button-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-frame-" w "-button")))
-                                (button-tables-images x w styletab-c:hightlight-maximize
-                                                      (if (eq styletab-c:hightlight-maximize-all t) t)))
+  (mapcar (lambda (w) (mapcar (lambda (x) (button-tables-images x w styletab-c:hightlight-maximize
+                                                                (if (eq styletab-c:hightlight-maximize-all t) t)))
                               (list "top" "bottom" "left" "right"))) (list "maximize" "unmaximize")))
 (define (shade-button-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-frame-" w "-button")))
-                                (button-tables-images x w styletab-c:hightlight-shade
-                                                      (if (eq styletab-c:hightlight-shade-all t) t)))
+  (mapcar (lambda (w) (mapcar (lambda (x) (button-tables-images x w styletab-c:hightlight-shade
+                                                                (if (eq styletab-c:hightlight-shade-all t) t)))
                               (list "top" "bottom" "left" "right"))) (list "shade" "unshade")))
 (define (sticky-button-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-frame-" w "-button")))
-                                (button-tables-images x w styletab-c:hightlight-sticky
-                                                      (if (eq styletab-c:hightlight-sticky-all t) t)))
+  (mapcar (lambda (w) (mapcar (lambda (x) (button-tables-images x w styletab-c:hightlight-sticky
+                                                                (if (eq styletab-c:hightlight-sticky-all t) t)))
                               (list "top" "bottom" "left" "right"))) (list "sticky" "unsticky")))
 (define (lock-button-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-frame-" w "-button")))
-                                (button-tables-images x w styletab-c:hightlight-lock
-                                                      (if (eq styletab-c:hightlight-lock-all t) t)))
+  (mapcar (lambda (w) (mapcar (lambda (x) (button-tables-images x w styletab-c:hightlight-lock
+                                                                (if (eq styletab-c:hightlight-lock-all t) t)))
                               (list "top" "bottom" "left" "right"))) (list "lock" "unlock")))
 (define (prev-button-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-frame-" w "-button")))
-                                (button-tables-images x w styletab-c:hightlight-prev
-                                                      (if (eq styletab-c:hightlight-prev-all t) t)))
+  (mapcar (lambda (w) (mapcar (lambda (x) (button-tables-images x w styletab-c:hightlight-prev
+                                                                (if (eq styletab-c:hightlight-prev-all t) t)))
                               (list "top" "bottom" "left" "right"))) (list "prev" "prev-last")))
 (define (next-button-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-frame-" w "-button")))
-                                (button-tables-images x w styletab-c:hightlight-next
-                                                      (if (eq styletab-c:hightlight-next-all t) t)))
+  (mapcar (lambda (w) (mapcar (lambda (x) (button-tables-images x w styletab-c:hightlight-next
+                                                                (if (eq styletab-c:hightlight-next-all t) t)))
                               (list "top" "bottom" "left" "right"))) (list "next" "next-last")))
 (define (raise-lower-button-images)
-  (mapcar (lambda (w) (mapcar (lambda (x) (when recolor-cache (table-unset styletab-frame-cache (concat x "-frame-" w "-button")))
-                                (button-tables-images x w styletab-c:hightlight-raise-lower
-                                                      (if (eq styletab-c:hightlight-raise-lower-all t) t)))
+  (mapcar (lambda (w) (mapcar (lambda (x) (button-tables-images x w styletab-c:hightlight-raise-lower
+                                                                (if (eq styletab-c:hightlight-raise-lower-all t) t)))
                               (list "top" "bottom" "left" "right"))) (list "raise-lower" "ontop" "unontop")))
 (define (recolor-base)
   (title-cursor-images) (title-nocursor-images) (top-border-images) (top-left-corner-images) (top-right-corner-images) (top-left-corner-shaped-images)
@@ -1089,6 +1052,13 @@
         (- styletab-c:borders-dimension)
       0)))
 
+(define sharped-edge
+  (lambda (w)
+    (if (or (eq current-type 'shaped) 
+            (eq current-type 'shaped-transient))
+        styletab-c:borders-dimension
+      0)))
+
 (define title-height (lambda (w) styletab-c:title-dimension)) 
 (define title-height-s (lambda (w) (- styletab-c:title-dimension 4)))
 (define title-edge (lambda (w) (- styletab-c:title-dimension)))
@@ -1099,104 +1069,104 @@
 (define right-frame-button-height (lambda (w) (+ styletab-c:title-dimension (button-width-custom))))
 
 (define top-frame-default-border-corner-group
-  `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-title")))
+  `(((class . top-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-title")))
      (left-edge . 0)
      (top-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,button-left-edge))
     ((class . top-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-top-left-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-top-left-corner")))
      (left-edge . ,frame-edge)
      (top-edge . ,title-edge)
      (height . ,title-height)
      (width . ,frame-width))
     ((class . top-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-top-right-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-top-right-corner")))
      (top-edge . ,title-edge)
      (right-edge . ,frame-edge)
      (height . ,title-height)
      (width . ,frame-width))
-    ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-title")))
+    ((class . top-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-title")))
      (right-edge . 0)
      (top-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,button-right-edge))))
 
 (define bottom-frame-default-border-corner-group
-  `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-title")))
+  `(((class . bottom-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-title")))
      (left-edge . 0)
      (bottom-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,button-left-edge))
     ((class . bottom-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-bottom-left-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-bottom-left-corner")))
      (left-edge . ,frame-edge)
      (bottom-edge . ,title-edge)
      (height . ,title-height)
      (width . ,frame-width))
     ((class . bottom-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-bottom-right-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-bottom-right-corner")))
      (bottom-edge . ,title-edge)
      (right-edge . ,frame-edge)
      (height . ,title-height)
      (width . ,frame-width))
-    ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-title")))
+    ((class . bottom-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-title")))
      (right-edge . 0)
      (bottom-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,button-right-edge))))
 
 (define left-frame-default-border-corner-group
-  `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-title")))
+  `(((class . top-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-title")))
      (top-edge . 0)
      (left-edge . ,title-edge-s)
      (height . ,button-right-edge)
      (width . ,title-height-s))
-    ((class . bottom-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-bottom-left-corner")))
-     (bottom-edge . ,frame-edge)
+    ((class . top-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-top-left-corner")))
+     (top-edge . ,frame-edge)
      (left-edge . ,title-edge)
      (height . ,frame-width)
      (width . ,title-height))
-    ((class . top-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-top-left-corner")))
-     (top-edge . ,frame-edge)
+    ((class . bottom-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-bottom-left-corner")))
+     (bottom-edge . ,frame-edge)
      (left-edge . ,title-edge)
      (height . ,frame-width)
      (width . ,title-height))
-    ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-title")))
+    ((class . bottom-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-title")))
      (bottom-edge . 0)
      (left-edge . ,title-edge-s)
      (height . ,button-left-edge)
      (width . ,title-height-s))))
 
 (define right-frame-default-border-corner-group
-  `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-title")))
+  `(((class . top-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-title")))
      (top-edge . 0)
      (right-edge . ,title-edge-s)
      (height . ,button-left-edge)
      (width . ,title-height-s))
-    ((class . bottom-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-bottom-right-corner")))
-     (bottom-edge . ,frame-edge)
+    ((class . top-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-top-right-corner")))
+     (top-edge . ,frame-edge)
      (right-edge . ,title-edge)
      (height . ,frame-width)
      (width . ,title-height))
-    ((class . top-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-top-right-corner")))
-     (top-edge . ,frame-edge)
+    ((class . bottom-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-bottom-right-corner")))
+     (bottom-edge . ,frame-edge)
      (right-edge . ,title-edge)
      (height . ,frame-width)
      (width . ,title-height))
-    ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-title")))
+    ((class . bottom-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-title")))
      (bottom-edge . 0)
      (right-edge . ,title-edge-s)
      (height . ,button-right-edge)
@@ -1204,33 +1174,33 @@
 
 (define top-frame-border-group
   `(((class . left-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-left-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-left-border")))
      (cursor . sb_h_double_arrow)
      (left-edge . ,frame-edge)
      (top-edge . 0)
      (width . ,frame-width)
      (bottom-edge . 0))
 	((class . bottom-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-bottom-left-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-bottom-left-corner")))
      (left-edge . ,frame-edge)
      (height . ,frame-width)
      (width . ,frame-width)
      (bottom-edge . ,frame-edge))
 	((class . bottom-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-bottom-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-bottom-border")))
      (cursor . sb_v_double_arrow)
      (left-edge . 0)
      (right-edge . 0)
      (height . ,frame-width)
      (bottom-edge . ,frame-edge))
 	((class . bottom-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-bottom-right-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-bottom-right-corner")))
      (right-edge . ,frame-edge)
      (height . ,frame-width)
      (width . ,frame-width)
      (bottom-edge . ,frame-edge))
 	((class . right-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-right-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-right-border")))
      (cursor . sb_h_double_arrow)
      (top-edge . 0)
      (right-edge . ,frame-edge)
@@ -1239,33 +1209,33 @@
 
 (define bottom-frame-border-group
   `(((class . left-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-left-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-left-border")))
      (cursor . sb_h_double_arrow)
      (left-edge . ,frame-edge)
      (bottom-edge . 0)
      (width . ,frame-width)
      (top-edge . 0))
     ((class . top-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-top-left-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-top-left-corner")))
      (left-edge . ,frame-edge)
      (height . ,frame-width)
      (width . ,frame-width)
      (top-edge . ,frame-edge))
     ((class . top-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-top-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-top-border")))
      (cursor . sb_v_double_arrow)
      (left-edge . 0)
      (right-edge . 0)
      (height . ,frame-width)
      (top-edge . ,frame-edge))
     ((class . top-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-top-right-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-top-right-corner")))
      (right-edge . ,frame-edge)
      (height . ,frame-width)
      (width . ,frame-width)
      (top-edge . ,frame-edge))
     ((class . right-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-right-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-right-border")))
      (cursor . sb_h_double_arrow)
      (bottom-edge . 0)
      (right-edge . ,frame-edge)
@@ -1274,33 +1244,33 @@
 
 (define left-frame-border-group
   `(((class . bottom-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-bottom-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-bottom-border")))
      (cursor . sb_v_double_arrow)
      (left-edge . 0)
      (right-edge . 0)
      (height . ,frame-width)
      (bottom-edge . ,frame-edge))
     ((class . bottom-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-bottom-right-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-bottom-right-corner")))
      (right-edge . ,frame-edge)
      (height . ,frame-width)
      (width . ,frame-width)
      (bottom-edge . ,frame-edge))
     ((class . right-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-right-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-right-border")))
      (cursor . sb_h_double_arrow)
      (top-edge . 0)
      (right-edge . ,frame-edge)
      (width . ,frame-width)
      (bottom-edge . 0))
     ((class . top-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-top-right-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-top-right-corner")))
      (top-edge . ,frame-edge)
      (right-edge . ,frame-edge)
      (height . ,frame-width)
      (width . ,frame-width))
     ((class . top-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-top-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-top-border")))
      (cursor . sb_v_double_arrow)
      (left-edge . 0)
      (right-edge . 0)
@@ -1309,33 +1279,33 @@
 
 (define right-frame-border-group
   `(((class . bottom-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-bottom-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-bottom-border")))
      (cursor . sb_v_double_arrow)
      (left-edge . 0)
      (right-edge . 0)
      (height . ,frame-width)
      (bottom-edge . ,frame-edge))
     ((class . bottom-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-bottom-left-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-bottom-left-corner")))
      (left-edge . ,frame-edge)
      (height . ,frame-width)
      (width . ,frame-width)
      (bottom-edge . ,frame-edge))
     ((class . left-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-left-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-left-border")))
      (cursor . sb_h_double_arrow)
      (top-edge . 0)
      (left-edge . ,frame-edge)
      (width . ,frame-width)
      (bottom-edge . 0))
     ((class . top-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-top-left-corner")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-top-left-corner")))
      (top-edge . ,frame-edge)
      (left-edge . ,frame-edge)
      (height . ,frame-width)
      (width . ,frame-width))
     ((class . top-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-top-border")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-top-border")))
      (cursor . sb_v_double_arrow)
      (left-edge . 0)
      (right-edge . 0)
@@ -1344,23 +1314,23 @@
 
 (define top-frame-title-group
   `(((class . top-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-title-cursor")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-title-cursor")))
      (cursor . sb_v_double_arrow)
-     (left-edge . 0)
+     (left-edge . ,sharped-edge)
      (top-edge . ,title-edge)
-     (right-edge . 0)
+     (right-edge . ,sharped-edge)
      (height . 2))
     ((class . tabbar-horizontal)
      (x-justify . ,(lambda (w) (- styletab-c:title-dimension 12)))
-     (y-justify . center)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-tab")))
+     (y-justify . ,(lambda (w) (+ (/ styletab-c:title-dimension 2) -7)))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-tab")))
      (foreground . ,title-colors-images)
      (top-edge . ,title-edge-s)
      (height . ,title-height-s)
      (text . ,window-name))
     ((class . tabbar-horizontal-left-edge)
      (foreground . ,(lambda (w) (window-icon w)))
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-tab-left-icon")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-tab-left-icon")))
      (cursor . hand2)
      (top-edge . ,title-edge-s)
      (height . ,title-height-s)
@@ -1368,35 +1338,35 @@
      (y-justify . 2)
      (x-justify . ,(lambda (w) (+ 3 (icon-edge w)))))
     ((class . tabbar-horizontal-right-edge)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-tab-right")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-tab-right")))
      (width . ,tabbar-right-edge-width)
      (height . ,title-height-s)
      (top-edge . ,title-edge-s))
     ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-title-nocursor")))
-     (left-edge . 0)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-title-nocursor")))
+     (left-edge . ,sharped-edge)
      (top-edge . -2)
-     (right-edge . 0)
+     (right-edge . ,sharped-edge)
      (height . 2))))
 
 (define bottom-frame-title-group
   `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-title-nocursor")))
-     (left-edge . 0)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-title-nocursor")))
+     (left-edge . ,sharped-edge)
      (bottom-edge . -2)
-     (right-edge . 0)
+     (right-edge . ,sharped-edge)
      (height . 2))
     ((class . tabbar-horizontal)
      (x-justify . ,(lambda (w) (- styletab-c:title-dimension 12)))
-     (y-justify . center)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-tab")))
+     (y-justify . ,(lambda (w) (+ (/ styletab-c:title-dimension 2) -7)))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-tab")))
      (foreground . ,title-colors-images)
      (bottom-edge . ,title-edge-s)
      (height . ,title-height-s)
      (text . ,window-name))
     ((class . tabbar-horizontal-left-edge)
      (foreground . ,(lambda (w) (window-icon w)))
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-tab-left-icon")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-tab-left-icon")))
      (cursor . hand2)
      (bottom-edge . ,title-edge-s)
      (height . ,title-height-s)
@@ -1404,29 +1374,29 @@
      (y-justify . 2)
      (x-justify . ,(lambda (w) (+ 3 (icon-edge w)))))
     ((class . tabbar-horizontal-right-edge)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-tab-right")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-tab-right")))
      (width . ,tabbar-right-edge-width)
      (height . ,title-height-s)
      (bottom-edge . ,title-edge-s))
     ((class . bottom-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-title-cursor")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-title-cursor")))
      (cursor . sb_v_double_arrow)
-     (left-edge . 0)
+     (left-edge . ,sharped-edge)
      (bottom-edge . ,title-edge)
-     (right-edge . 0)
+     (right-edge . ,sharped-edge)
      (height . 2))))
 
 (define left-frame-title-group
   `(((class . left-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-title-cursor")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-title-cursor")))
      (cursor . sb_h_double_arrow)
-     (top-edge . 0)
+     (top-edge . ,sharped-edge)
      (left-edge . ,title-edge)
-     (bottom-edge . 0)
+     (bottom-edge . ,sharped-edge)
      (width . 2))
     ((class . tabbar-vertical-top-edge)
      (foreground . ,(lambda (w) (window-icon w)))
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-tab-top")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-tab-top")))
      (cursor . hand2)
      (height . ,(lambda (w) (+ 2 (title-height-s w))))
      (width . ,title-height-s)
@@ -1436,35 +1406,35 @@
     ((class . tabbar-vertical)
      (x-justify . 12)
      (y-justify . center)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-tab")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-tab")))
      (left-edge . ,title-edge-s)
      (width . ,title-height-s))
     ((class . tabbar-vertical-bottom-edge)
      (foreground . ,(lambda (w) (window-icon w)))
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-tab-bottom-icon")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-tab-bottom-icon")))
      (left-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,title-height-s)
      (y-justify . ,(lambda (w) (- (+ 0 (icon-edge w)))))
      (x-justify . 2))
     ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-title-nocursor")))
-     (top-edge . 0)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-title-nocursor")))
+     (top-edge . ,sharped-edge)
      (left-edge . -2)
-     (bottom-edge . 0)
+     (bottom-edge . ,sharped-edge)
      (width . 2))))
 
 (define right-frame-title-group
   `(((class . right-border)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-title-cursor")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-title-cursor")))
      (cursor . sb_h_double_arrow)
-     (top-edge . 0)
+     (top-edge . ,sharped-edge)
      (right-edge . ,title-edge)
-     (bottom-edge . 0)
+     (bottom-edge . ,sharped-edge)
      (width . 2))
     ((class . tabbar-vertical-top-edge)
      (foreground . ,(lambda (w) (window-icon w)))
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-tab-top")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-tab-top")))
      (cursor . hand2)
      (height . ,(lambda (w) (+ 2 (title-height-s w))))
      (width . ,title-height-s)
@@ -1474,28 +1444,28 @@
     ((class . tabbar-vertical)
      (x-justify . 12)
      (y-justify . center)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-tab")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-tab")))
      (right-edge . ,title-edge-s)
      (width . ,title-height-s))
     ((class . tabbar-vertical-bottom-edge)
      (foreground . ,(lambda (w) (window-icon w)))
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-tab-bottom-icon")))
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-tab-bottom-icon")))
      (right-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,title-height-s)
      (y-justify . ,(lambda (w) (- (+ 0 (icon-edge w)))))
      (x-justify . 2))
     ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-title-nocursor")))
-     (top-edge . 0)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-title-nocursor")))
+     (top-edge . ,sharped-edge)
      (right-edge . -2)
-     (bottom-edge . 0)
+     (bottom-edge . ,sharped-edge)
      (width . 2))))
 
 (define top-frame-close-button
   `((class . close-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-close-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-close-button")))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1503,8 +1473,8 @@
 
 (define bottom-frame-close-button
   `((class . close-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-close-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-close-button")))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1512,8 +1482,8 @@
 
 (define left-frame-close-button
   `((class . close-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-close-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-close-button")))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1521,8 +1491,8 @@
 
 (define right-frame-close-button
   `((class . close-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-close-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-close-button")))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1530,8 +1500,8 @@
 
 (define top-frame-menu-button
   `((class . menu-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-menu-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-menu-button")))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1539,8 +1509,8 @@
 
 (define bottom-frame-menu-button
   `((class . menu-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-menu-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-menu-button")))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1548,8 +1518,8 @@
 
 (define left-frame-menu-button
   `((class . menu-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-menu-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-menu-button")))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1557,8 +1527,8 @@
 
 (define right-frame-menu-button
   `((class . menu-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-menu-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-menu-button")))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1566,8 +1536,8 @@
 
 (define top-frame-iconify-button
   `((class . iconify-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-iconify-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-iconify-button")))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1575,8 +1545,8 @@
 
 (define bottom-frame-iconify-button
   `((class . iconify-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-iconify-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-iconify-button")))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1584,8 +1554,8 @@
 
 (define left-frame-iconify-button
   `((class . iconify-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-iconify-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-iconify-button")))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1593,8 +1563,8 @@
 
 (define right-frame-iconify-button
   `((class . iconify-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-iconify-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-iconify-button")))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1602,10 +1572,10 @@
 
 (define top-frame-maximize-button
   `((class . maximize-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'unmaximized-geometry) 
-                                   (table-ref styletab-frame-cache '"top-frame-unmaximize-button") 
-                                 (table-ref styletab-frame-cache '"top-frame-maximize-button"))))
+                                   (table-ref styletab-c-frame-cache '"top-frame-unmaximize-button") 
+                                 (table-ref styletab-c-frame-cache '"top-frame-maximize-button"))))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1613,10 +1583,10 @@
 
 (define bottom-frame-maximize-button
   `((class . maximize-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'unmaximized-geometry) 
-                                   (table-ref styletab-frame-cache '"bottom-frame-unmaximize-button") 
-                                 (table-ref styletab-frame-cache '"bottom-frame-maximize-button"))))
+                                   (table-ref styletab-c-frame-cache '"bottom-frame-unmaximize-button") 
+                                 (table-ref styletab-c-frame-cache '"bottom-frame-maximize-button"))))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1624,10 +1594,10 @@
 
 (define left-frame-maximize-button
   `((class . maximize-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'unmaximized-geometry) 
-                                   (table-ref styletab-frame-cache '"left-frame-unmaximize-button") 
-                                 (table-ref styletab-frame-cache '"left-frame-maximize-button"))))
+                                   (table-ref styletab-c-frame-cache '"left-frame-unmaximize-button") 
+                                 (table-ref styletab-c-frame-cache '"left-frame-maximize-button"))))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1635,10 +1605,10 @@
 
 (define right-frame-maximize-button
   `((class . maximize-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'unmaximized-geometry) 
-                                   (table-ref styletab-frame-cache '"right-frame-unmaximize-button") 
-                                 (table-ref styletab-frame-cache '"right-frame-maximize-button"))))
+                                   (table-ref styletab-c-frame-cache '"right-frame-unmaximize-button") 
+                                 (table-ref styletab-c-frame-cache '"right-frame-maximize-button"))))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1646,10 +1616,10 @@
 
 (define top-frame-shade-button
   `((class . shade-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'shaded) 
-                                   (table-ref styletab-frame-cache '"top-frame-unshade-button") 
-                                 (table-ref styletab-frame-cache '"top-frame-shade-button"))))
+                                   (table-ref styletab-c-frame-cache '"top-frame-unshade-button") 
+                                 (table-ref styletab-c-frame-cache '"top-frame-shade-button"))))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1657,10 +1627,10 @@
 
 (define bottom-frame-shade-button
   `((class . shade-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'shaded) 
-                                   (table-ref styletab-frame-cache '"bottom-frame-unshade-button") 
-                                 (table-ref styletab-frame-cache '"bottom-frame-shade-button"))))
+                                   (table-ref styletab-c-frame-cache '"bottom-frame-unshade-button") 
+                                 (table-ref styletab-c-frame-cache '"bottom-frame-shade-button"))))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1668,10 +1638,10 @@
 
 (define left-frame-shade-button
   `((class . shade-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'shaded) 
-                                   (table-ref styletab-frame-cache '"left-frame-unshade-button") 
-                                 (table-ref styletab-frame-cache '"left-frame-shade-button"))))
+                                   (table-ref styletab-c-frame-cache '"left-frame-unshade-button") 
+                                 (table-ref styletab-c-frame-cache '"left-frame-shade-button"))))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1679,10 +1649,10 @@
 
 (define right-frame-shade-button
   `((class . shade-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'shaded) 
-                                   (table-ref styletab-frame-cache '"right-frame-unshade-button") 
-                                 (table-ref styletab-frame-cache '"right-frame-shade-button"))))
+                                   (table-ref styletab-c-frame-cache '"right-frame-unshade-button") 
+                                 (table-ref styletab-c-frame-cache '"right-frame-shade-button"))))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1690,10 +1660,10 @@
 
 (define top-frame-sticky-button
   `((class . sticky-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'sticky) 
-                                   (table-ref styletab-frame-cache '"top-frame-unsticky-button") 
-                                 (table-ref styletab-frame-cache '"top-frame-sticky-button"))))
+                                   (table-ref styletab-c-frame-cache '"top-frame-unsticky-button") 
+                                 (table-ref styletab-c-frame-cache '"top-frame-sticky-button"))))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1701,10 +1671,10 @@
 
 (define bottom-frame-sticky-button
   `((class . sticky-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'sticky) 
-                                   (table-ref styletab-frame-cache '"bottom-frame-unsticky-button") 
-                                 (table-ref styletab-frame-cache '"bottom-frame-sticky-button"))))
+                                   (table-ref styletab-c-frame-cache '"bottom-frame-unsticky-button") 
+                                 (table-ref styletab-c-frame-cache '"bottom-frame-sticky-button"))))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1712,10 +1682,10 @@
 
 (define left-frame-sticky-button
   `((class . sticky-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'sticky) 
-                                   (table-ref styletab-frame-cache '"left-frame-unsticky-button") 
-                                 (table-ref styletab-frame-cache '"left-frame-sticky-button"))))
+                                   (table-ref styletab-c-frame-cache '"left-frame-unsticky-button") 
+                                 (table-ref styletab-c-frame-cache '"left-frame-sticky-button"))))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1723,10 +1693,10 @@
 
 (define right-frame-sticky-button
   `((class . sticky-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'sticky) 
-                                   (table-ref styletab-frame-cache '"right-frame-unsticky-button") 
-                                 (table-ref styletab-frame-cache '"right-frame-sticky-button"))))
+                                   (table-ref styletab-c-frame-cache '"right-frame-unsticky-button") 
+                                 (table-ref styletab-c-frame-cache '"right-frame-sticky-button"))))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1734,38 +1704,38 @@
 
 (define top-frame-space-button
   `((class . title)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-title")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-title")))
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
     (width . ,top-frame-button-width)))
 
 (define bottom-frame-space-button
   `((class . title)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-title")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-title")))
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
     (width . ,bottom-frame-button-width)))
 
 (define left-frame-space-button
   `((class . title)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-title")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-title")))
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
     (width . ,title-height-s)))
 
 (define right-frame-space-button
   `((class . title)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-title")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-title")))
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
     (width . ,title-height-s)))
 
 (define top-frame-prev-button
   `((class . previous-workspace-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
     (foreground . ,(lambda (w) (if (or (window-in-workspace-p w (- (get-first-workspace) 1)) (window-get w 'sticky))
-                                   (table-ref styletab-frame-cache '"top-frame-prev-last-button")   
-                                 (table-ref styletab-frame-cache '"top-frame-prev-button"))))    
+                                   (table-ref styletab-c-frame-cache '"top-frame-prev-last-button")   
+                                 (table-ref styletab-c-frame-cache '"top-frame-prev-button"))))    
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1773,10 +1743,10 @@
 
 (define bottom-frame-prev-button
   `((class . previous-workspace-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
     (foreground . ,(lambda (w) (if (or (window-in-workspace-p w (- (get-first-workspace) 1)) (window-get w 'sticky))
-                                   (table-ref styletab-frame-cache '"bottom-frame-prev-last-button")   
-                                 (table-ref styletab-frame-cache '"bottom-frame-prev-button"))))    
+                                   (table-ref styletab-c-frame-cache '"bottom-frame-prev-last-button")   
+                                 (table-ref styletab-c-frame-cache '"bottom-frame-prev-button"))))    
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1784,10 +1754,10 @@
 
 (define left-frame-prev-button
   `((class . previous-workspace-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
     (foreground . ,(lambda (w) (if (or (window-in-workspace-p w (- (get-first-workspace) 1)) (window-get w 'sticky))
-                                   (table-ref styletab-frame-cache '"left-frame-prev-last-button")   
-                                 (table-ref styletab-frame-cache '"left-frame-prev-button"))))    
+                                   (table-ref styletab-c-frame-cache '"left-frame-prev-last-button")   
+                                 (table-ref styletab-c-frame-cache '"left-frame-prev-button"))))    
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1795,10 +1765,10 @@
 
 (define right-frame-prev-button
   `((class . previous-workspace-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
     (foreground . ,(lambda (w) (if (or (window-in-workspace-p w (- (get-first-workspace) 1)) (window-get w 'sticky))
-                                   (table-ref styletab-frame-cache '"right-frame-prev-last-button")   
-                                 (table-ref styletab-frame-cache '"right-frame-prev-button"))))    
+                                   (table-ref styletab-c-frame-cache '"right-frame-prev-last-button")   
+                                 (table-ref styletab-c-frame-cache '"right-frame-prev-button"))))    
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1806,10 +1776,10 @@
 
 (define top-frame-next-button
   `((class . next-workspace-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
     (foreground . ,(lambda (w) (if (or (window-in-workspace-p w (- (get-last-workspace) 1)) (window-get w 'sticky))
-                                   (table-ref styletab-frame-cache '"top-frame-next-last-button")   
-                                 (table-ref styletab-frame-cache '"top-frame-next-button"))))    
+                                   (table-ref styletab-c-frame-cache '"top-frame-next-last-button")   
+                                 (table-ref styletab-c-frame-cache '"top-frame-next-button"))))    
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1817,10 +1787,10 @@
 
 (define bottom-frame-next-button
   `((class . next-workspace-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
     (foreground . ,(lambda (w) (if (or (window-in-workspace-p w (- (get-last-workspace) 1)) (window-get w 'sticky))
-                                   (table-ref styletab-frame-cache '"bottom-frame-next-last-button")   
-                                 (table-ref styletab-frame-cache '"bottom-frame-next-button"))))    
+                                   (table-ref styletab-c-frame-cache '"bottom-frame-next-last-button")   
+                                 (table-ref styletab-c-frame-cache '"bottom-frame-next-button"))))    
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1828,10 +1798,10 @@
 
 (define left-frame-next-button
   `((class . next-workspace-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
     (foreground . ,(lambda (w) (if (or (window-in-workspace-p w (- (get-last-workspace) 1)) (window-get w 'sticky))
-                                   (table-ref styletab-frame-cache '"left-frame-next-last-button")   
-                                 (table-ref styletab-frame-cache '"left-frame-next-button"))))    
+                                   (table-ref styletab-c-frame-cache '"left-frame-next-last-button")   
+                                 (table-ref styletab-c-frame-cache '"left-frame-next-button"))))    
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1839,10 +1809,10 @@
 
 (define right-frame-next-button
   `((class . next-workspace-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
     (foreground . ,(lambda (w) (if (or (window-in-workspace-p w (- (get-last-workspace) 1)) (window-get w 'sticky))
-                                   (table-ref styletab-frame-cache '"right-frame-next-last-button")   
-                                 (table-ref styletab-frame-cache '"right-frame-next-button"))))    
+                                   (table-ref styletab-c-frame-cache '"right-frame-next-last-button")   
+                                 (table-ref styletab-c-frame-cache '"right-frame-next-button"))))    
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1850,10 +1820,10 @@
 
 (define top-frame-lock-button
   `((class . lock-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'fixed-position) 
-                                   (table-ref styletab-frame-cache '"top-frame-unlock-button") 
-                                 (table-ref styletab-frame-cache '"top-frame-lock-button"))))
+                                   (table-ref styletab-c-frame-cache '"top-frame-unlock-button") 
+                                 (table-ref styletab-c-frame-cache '"top-frame-lock-button"))))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1861,10 +1831,10 @@
 
 (define bottom-frame-lock-button
   `((class . lock-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'fixed-position) 
-                                   (table-ref styletab-frame-cache '"bottom-frame-unlock-button") 
-                                 (table-ref styletab-frame-cache '"bottom-frame-lock-button"))))
+                                   (table-ref styletab-c-frame-cache '"bottom-frame-unlock-button") 
+                                 (table-ref styletab-c-frame-cache '"bottom-frame-lock-button"))))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1872,10 +1842,10 @@
 
 (define left-frame-lock-button
   `((class . lock-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'fixed-position) 
-                                   (table-ref styletab-frame-cache '"left-frame-unlock-button") 
-                                 (table-ref styletab-frame-cache '"left-frame-lock-button"))))
+                                   (table-ref styletab-c-frame-cache '"left-frame-unlock-button") 
+                                 (table-ref styletab-c-frame-cache '"left-frame-lock-button"))))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1883,10 +1853,10 @@
 
 (define right-frame-lock-button
   `((class . lock-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
     (foreground . ,(lambda (w) (if (window-get w 'fixed-position) 
-                                   (table-ref styletab-frame-cache '"right-frame-unlock-button") 
-                                 (table-ref styletab-frame-cache '"right-frame-lock-button"))))
+                                   (table-ref styletab-c-frame-cache '"right-frame-unlock-button") 
+                                 (table-ref styletab-c-frame-cache '"right-frame-lock-button"))))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1894,11 +1864,11 @@
 
 (define top-frame-raise-lower-button
   `((class . raise-lower-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
-    (foreground . ,(lambda (w) (if (= (window-get w 'depth) 0) (table-ref styletab-frame-cache '"top-frame-raise-lower-button") 
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
+    (foreground . ,(lambda (w) (if (= (window-get w 'depth) 0) (table-ref styletab-c-frame-cache '"top-frame-raise-lower-button") 
                                  (if (> (window-get w 'depth) 0) 
-                                     (table-ref styletab-frame-cache '"top-frame-ontop-button")
-                                   (table-ref styletab-frame-cache '"top-frame-unontop-button")))))
+                                     (table-ref styletab-c-frame-cache '"top-frame-ontop-button")
+                                   (table-ref styletab-c-frame-cache '"top-frame-unontop-button")))))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1906,11 +1876,11 @@
 
 (define bottom-frame-raise-lower-button
   `((class . raise-lower-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
-    (foreground . ,(lambda (w) (if (= (window-get w 'depth) 0) (table-ref styletab-frame-cache '"bottom-frame-raise-lower-button") 
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
+    (foreground . ,(lambda (w) (if (= (window-get w 'depth) 0) (table-ref styletab-c-frame-cache '"bottom-frame-raise-lower-button") 
                                  (if (> (window-get w 'depth) 0) 
-                                     (table-ref styletab-frame-cache '"bottom-frame-ontop-button")
-                                   (table-ref styletab-frame-cache '"bottom-frame-unontop-button")))))
+                                     (table-ref styletab-c-frame-cache '"bottom-frame-ontop-button")
+                                   (table-ref styletab-c-frame-cache '"bottom-frame-unontop-button")))))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1918,11 +1888,11 @@
 
 (define left-frame-raise-lower-button
   `((class . raise-lower-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
-    (foreground . ,(lambda (w) (if (= (window-get w 'depth) 0) (table-ref styletab-frame-cache '"left-frame-raise-lower-button") 
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
+    (foreground . ,(lambda (w) (if (= (window-get w 'depth) 0) (table-ref styletab-c-frame-cache '"left-frame-raise-lower-button") 
                                  (if (> (window-get w 'depth) 0) 
-                                     (table-ref styletab-frame-cache '"left-frame-ontop-button")
-                                   (table-ref styletab-frame-cache '"left-frame-unontop-button")))))
+                                     (table-ref styletab-c-frame-cache '"left-frame-ontop-button")
+                                   (table-ref styletab-c-frame-cache '"left-frame-unontop-button")))))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1930,11 +1900,11 @@
 
 (define right-frame-raise-lower-button
   `((class . raise-lower-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
-    (foreground . ,(lambda (w) (if (= (window-get w 'depth) 0) (table-ref styletab-frame-cache '"right-frame-raise-lower-button") 
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
+    (foreground . ,(lambda (w) (if (= (window-get w 'depth) 0) (table-ref styletab-c-frame-cache '"right-frame-raise-lower-button") 
                                  (if (> (window-get w 'depth) 0) 
-                                     (table-ref styletab-frame-cache '"right-frame-ontop-button")
-                                   (table-ref styletab-frame-cache '"right-frame-unontop-button")))))
+                                     (table-ref styletab-c-frame-cache '"right-frame-ontop-button")
+                                   (table-ref styletab-c-frame-cache '"right-frame-unontop-button")))))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1942,8 +1912,8 @@
 
 (define  top-frame-move-resize-button
   `((class . move-resize-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-move-resize-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-move-resize-button")))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1951,8 +1921,8 @@
 
 (define  bottom-frame-move-resize-button
   `((class . move-resize-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-move-resize-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-move-resize-button")))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1960,8 +1930,8 @@
 
 (define  left-frame-move-resize-button
   `((class . move-resize-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-move-resize-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-move-resize-button")))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -1969,8 +1939,8 @@
 
 (define  right-frame-move-resize-button
   `((class . move-resize-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-move-resize-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-move-resize-button")))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -1978,8 +1948,8 @@
 
 (define top-frame-rename-button
   `((class . rename-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-rename-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-rename-button")))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1987,8 +1957,8 @@
 
 (define bottom-frame-rename-button
   `((class . rename-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-rename-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-rename-button")))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -1996,8 +1966,8 @@
 
 (define left-frame-rename-button
   `((class . rename-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-rename-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-rename-button")))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -2005,8 +1975,8 @@
 
 (define right-frame-rename-button
   `((class . rename-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-rename-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-rename-button")))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
@@ -2014,8 +1984,8 @@
 
 (define top-frame-frame-type-button
   `((class . frame-type-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-frame-type-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-frame-type-button")))
     (cursor . hand2)
     (top-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -2023,8 +1993,8 @@
 
 (define bottom-frame-frame-type-button
   `((class . frame-type-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-frame-type-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-frame-type-button")))
     (cursor . hand2)
     (bottom-edge . ,title-edge-s)
     (height . ,title-height-s)
@@ -2032,8 +2002,8 @@
 
 (define left-frame-frame-type-button
   `((class . frame-type-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-frame-type-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-frame-type-button")))
     (cursor . hand2)
     (left-edge . ,title-edge-s)
     (height . ,left-frame-button-height)
@@ -2041,117 +2011,153 @@
 
 (define right-frame-frame-type-button
   `((class . frame-type-button)
-    (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-button")))
-    (foreground . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-frame-type-button")))
+    (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
+    (foreground . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-frame-type-button")))
     (cursor . hand2)
     (right-edge . ,title-edge-s)
     (height . ,right-frame-button-height)
     (width . ,title-height-s)))
 
 (define top-frame-shaped-border-corner-group
-  `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-title")))
-     (left-edge . 0)
+  `(((class . top-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-title")))
+     (left-edge . ,sharped-edge)
      (top-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,button-left-edge))
     ((class . top-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-top-left-corner-shaped")))
-     (cursor . sb_h_double_arrow)
+     (background . ,(lambda (w) (if (window-get w 'shaded) 
+                                    (table-ref styletab-c-frame-cache '"top-frame-top-left-corner-shaped")
+                                  (table-ref styletab-c-frame-cache '"top-frame-top-left-corner"))))
      (left-edge . ,frame-edge)
      (top-edge . ,title-edge)
      (height . ,title-height)
-     (width . ,frame-width))
+     (width . ,(lambda (w) (if (or (eq current-type 'shaped)
+                                   (eq current-type 'shaped-transient))
+                               styletab-c:borders-dimension
+                             (if (window-get w 'shaded) styletab-c:borders-dimension sharped-edge)))))
     ((class . top-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-top-right-corner-shaped")))
-     (cursor . sb_h_double_arrow)
+     (background . ,(lambda (w) (if (window-get w 'shaded) 
+                                    (table-ref styletab-c-frame-cache '"top-frame-top-right-corner-shaped")
+                                  (table-ref styletab-c-frame-cache '"top-frame-top-right-corner"))))
      (top-edge . ,title-edge)
      (right-edge . ,frame-edge)
      (height . ,title-height)
-     (width . ,frame-width))
-    ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"top-frame-title")))
-     (right-edge . 0)
+     (width . ,(lambda (w) (if (or (eq current-type 'shaped)
+                                   (eq current-type 'shaped-transient))
+                               styletab-c:borders-dimension
+                             (if (window-get w 'shaded) styletab-c:borders-dimension sharped-edge)))))
+    ((class . top-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-title")))
+     (right-edge . ,sharped-edge)
      (top-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,button-right-edge))))
 
 (define bottom-frame-shaped-border-corner-group
-  `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-title")))
-     (left-edge . 0)
+  `(((class . bottom-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-title")))
+     (left-edge . ,sharped-edge)
      (bottom-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,button-left-edge))
     ((class . bottom-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-bottom-left-corner-shaped")))
-     (cursor . sb_h_double_arrow)
+     (background . ,(lambda (w) (if (window-get w 'shaded) 
+                                    (table-ref styletab-c-frame-cache '"bottom-frame-bottom-left-corner-shaped")
+                                  (table-ref styletab-c-frame-cache '"bottom-frame-bottom-left-corner"))))
      (left-edge . ,frame-edge)
      (bottom-edge . ,title-edge)
      (height . ,title-height)
-     (width . ,frame-width))
+     (width . ,(lambda (w) (if (or (eq current-type 'shaped)
+                                   (eq current-type 'shaped-transient))
+                               styletab-c:borders-dimension
+                             (if (window-get w 'shaded) styletab-c:borders-dimension sharped-edge)))))
     ((class . bottom-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-bottom-right-corner-shaped")))
-     (cursor . sb_h_double_arrow)
+     (background . ,(lambda (w) (if (window-get w 'shaded) 
+                                    (table-ref styletab-c-frame-cache '"bottom-frame-bottom-right-corner-shaped")
+                                  (table-ref styletab-c-frame-cache '"bottom-frame-bottom-right-corner"))))
      (bottom-edge . ,title-edge)
      (right-edge . ,frame-edge)
      (height . ,title-height)
-     (width . ,frame-width))
-    ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"bottom-frame-title")))
-     (right-edge . 0)
+     (width . ,(lambda (w) (if (or (eq current-type 'shaped)
+                                   (eq current-type 'shaped-transient))
+                               styletab-c:borders-dimension
+                             (if (window-get w 'shaded) styletab-c:borders-dimension sharped-edge)))))
+    ((class . bottom-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-title")))
+     (right-edge . ,sharped-edge)
      (bottom-edge . ,title-edge-s)
      (height . ,title-height-s)
      (width . ,button-right-edge))))
 
 (define left-frame-shaped-border-corner-group
-  `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-title")))
-     (top-edge . 0)
+  `(((class . top-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-title")))
+     (top-edge . ,sharped-edge)
      (left-edge . ,title-edge-s)
      (height . ,button-right-edge)
      (width . ,title-height-s))
-    ((class . bottom-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-bottom-left-corner-shaped")))
-     (bottom-edge . ,frame-edge)
-     (left-edge . ,title-edge)
-     (height . ,frame-width)
-     (width . ,title-height))
     ((class . top-left-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-top-left-corner-shaped")))
+     (background . ,(lambda (w) (if (window-get w 'shaded) 
+                                    (table-ref styletab-c-frame-cache '"left-frame-top-left-corner-shaped")
+                                  (table-ref styletab-c-frame-cache '"left-frame-top-left-corner"))))
      (top-edge . ,frame-edge)
      (left-edge . ,title-edge)
-     (height . ,frame-width)
+     (height . ,(lambda (w) (if (or (eq current-type 'shaped)
+                                    (eq current-type 'shaped-transient))
+                                styletab-c:borders-dimension
+                              (if (window-get w 'shaded) styletab-c:borders-dimension sharped-edge))))
      (width . ,title-height))
-    ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"left-frame-title")))
-     (bottom-edge . 0)
+    ((class . bottom-left-corner)
+     (background . ,(lambda (w) (if (window-get w 'shaded) 
+                                    (table-ref styletab-c-frame-cache '"left-frame-bottom-left-corner-shaped")
+                                  (table-ref styletab-c-frame-cache '"left-frame-bottom-left-corner"))))
+     (bottom-edge . ,frame-edge)
+     (left-edge . ,title-edge)
+     (height . ,(lambda (w) (if (or (eq current-type 'shaped)
+                                    (eq current-type 'shaped-transient))
+                                styletab-c:borders-dimension
+                              (if (window-get w 'shaded) styletab-c:borders-dimension sharped-edge))))
+     (width . ,title-height))
+    ((class . bottom-left-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-title")))
+     (bottom-edge . ,sharped-edge)
      (left-edge . ,title-edge-s)
      (height . ,button-left-edge)
      (width . ,title-height-s))))
 
 (define right-frame-shaped-border-corner-group
-  `(((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-title")))
-     (top-edge . 0)
+  `(((class . top-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-title")))
+     (top-edge . ,sharped-edge)
      (right-edge . ,title-edge-s)
      (height . ,button-left-edge)
      (width . ,title-height-s))
-    ((class . bottom-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-bottom-right-corner-shaped")))
-     (bottom-edge . ,frame-edge)
-     (right-edge . ,title-edge)
-     (height . ,frame-width)
-     (width . ,title-height))
     ((class . top-right-corner)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-top-right-corner-shaped")))
+     (background . ,(lambda (w) (if (window-get w 'shaded) 
+                                    (table-ref styletab-c-frame-cache '"right-frame-top-right-corner-shaped")
+                                  (table-ref styletab-c-frame-cache '"right-frame-top-right-corner"))))
      (top-edge . ,frame-edge)
      (right-edge . ,title-edge)
-     (height . ,frame-width)
+     (height . ,(lambda (w) (if (or (eq current-type 'shaped)
+                                    (eq current-type 'shaped-transient))
+                                styletab-c:borders-dimension
+                              (if (window-get w 'shaded) styletab-c:borders-dimension sharped-edge))))
      (width . ,title-height))
-    ((class . title)
-     (background . ,(lambda (w) (table-ref styletab-frame-cache '"right-frame-title")))
-     (bottom-edge . 0)
+    ((class . bottom-right-corner)
+     (background . ,(lambda (w) (if (window-get w 'shaded) 
+                                    (table-ref styletab-c-frame-cache '"right-frame-bottom-right-corner-shaped")
+                                  (table-ref styletab-c-frame-cache '"right-frame-bottom-right-corner"))))
+     (bottom-edge . ,frame-edge)
+     (right-edge . ,title-edge)
+     (height . ,(lambda (w) (if (or (eq current-type 'shaped)
+                                    (eq current-type 'shaped-transient))
+                                styletab-c:borders-dimension
+                              (if (window-get w 'shaded) styletab-c:borders-dimension sharped-edge))))
+     (width . ,title-height))
+    ((class . bottom-right-corner)
+     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-title")))
+     (bottom-edge . ,sharped-edge)
      (right-edge . ,title-edge-s)
      (height . ,button-right-edge)
      (width . ,title-height-s))))
@@ -2227,21 +2233,17 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
 ;;; build themes
 
-(define normal-frame nil)
-(define shaped-frame nil)
-(define transient-frame nil)
-(define shaped-transient-frame nil)
+(define frame nil)
 (define button-alist nil)
 (define current-title styletab-c:titlebar-place)
-(define top-tab-adjustments nil)
-(define bottom-tab-adjustments nil)
-(define left-tab-adjustments nil)
-(define right-tab-adjustments nil)
+(define current-type nil)
+(define recolor-lock t)
 
 ;; botton list table
-(define styletab-botton-cache (make-table equal-hash equal))
+(define styletab-c-botton-cache (make-table equal-hash equal))
+
 (define (make-buttons)
-  (setq styletab-botton-cache (make-weak-table equal-hash equal))
+  (setq styletab-c-botton-cache (make-weak-table equal-hash equal))
   ;; ripped from Anonymous
   (let* (;; turns one cons cell (btn-name . show-in-transients) into a button
          ;; definition, adding the button position
@@ -2265,283 +2267,333 @@
                       (loop (cdr rest) pos result)
                     (loop (cdr rest) (+ pos pos-inc) (append (list new-btn) result))))))))
 
-         (adjus
-          (lambda (b-list) 
-            (if (numberp (cdr (car (car b-list))))
-                (+ (cdr (car (car b-list))) (+ styletab-c:title-dimension (button-width-custom))) 0)))
-
          (setalist (setq button-alist top-button-alist))
          (top-normal-buttons-left
+          (make-button-list nil styletab-c:top-left-buttons 'left-edge (+ (button-left-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (top-normal-buttons-left-s
           (make-button-list nil styletab-c:top-left-buttons 'left-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (top-normal-buttons-right
+          (make-button-list nil styletab-c:top-right-buttons 'right-edge (+ (button-right-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (top-normal-buttons-right-s
           (make-button-list nil styletab-c:top-right-buttons 'right-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (top-transient-buttons-left
+          (make-button-list t styletab-c:top-left-buttons 'left-edge (+ (button-left-edge) styletab-c:borders-dimension)
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (top-transient-buttons-left-s
           (make-button-list t styletab-c:top-left-buttons 'left-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (top-transient-buttons-right
+          (make-button-list t styletab-c:top-right-buttons 'right-edge (+ (button-right-edge) styletab-c:borders-dimension)
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (top-transient-buttons-right-s
           (make-button-list t styletab-c:top-right-buttons 'right-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
-         
+
          (setalist (setq button-alist bottom-button-alist))
-         (bottom-normal-buttons-left 
+         (bottom-normal-buttons-left
+          (make-button-list nil styletab-c:bottom-left-buttons 'left-edge (+ (button-left-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (bottom-normal-buttons-left-s
           (make-button-list nil styletab-c:bottom-left-buttons 'left-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (bottom-normal-buttons-right
+          (make-button-list nil styletab-c:bottom-right-buttons 'right-edge (+ (button-right-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (bottom-normal-buttons-right-s
           (make-button-list nil styletab-c:bottom-right-buttons 'right-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (bottom-transient-buttons-left
+          (make-button-list t styletab-c:bottom-left-buttons 'left-edge (+ (button-left-edge) styletab-c:borders-dimension)
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (bottom-transient-buttons-left-s
           (make-button-list t styletab-c:bottom-left-buttons 'left-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (bottom-transient-buttons-right
+          (make-button-list t styletab-c:bottom-right-buttons 'right-edge (+ (button-right-edge) styletab-c:borders-dimension)
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (bottom-transient-buttons-right-s
           (make-button-list t styletab-c:bottom-right-buttons 'right-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
-         
+
          (setalist (setq button-alist left-button-alist))
-         (left-normal-buttons-bottom 
-          (make-button-list nil styletab-c:left-bottom-buttons 'bottom-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (left-normal-buttons-top
+          (make-button-list nil styletab-c:left-top-buttons 'top-edge (+ (button-right-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (left-normal-buttons-top-s
           (make-button-list nil styletab-c:left-top-buttons 'top-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
-         (left-transient-buttons-bottom
-          (make-button-list t styletab-c:left-bottom-buttons 'bottom-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
+         (left-normal-buttons-bottom 
+          (make-button-list nil styletab-c:left-bottom-buttons 'bottom-edge (+ (button-left-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (left-normal-buttons-bottom-s
+          (make-button-list nil styletab-c:left-bottom-buttons 'bottom-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (left-transient-buttons-top
+          (make-button-list t styletab-c:left-top-buttons 'top-edge (+ (button-right-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (left-transient-buttons-top-s
           (make-button-list t styletab-c:left-top-buttons 'top-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
+         (left-transient-buttons-bottom
+          (make-button-list t styletab-c:left-bottom-buttons 'bottom-edge (+ (button-left-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (left-transient-buttons-bottom-s
+          (make-button-list t styletab-c:left-bottom-buttons 'bottom-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
          
          (setalist (setq button-alist right-button-alist))
-         (right-normal-buttons-bottom 
-          (make-button-list nil styletab-c:right-bottom-buttons 'bottom-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (right-normal-buttons-top
+          (make-button-list nil styletab-c:right-top-buttons 'top-edge (+ (button-left-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (right-normal-buttons-top-s
           (make-button-list nil styletab-c:right-top-buttons 'top-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
-         (right-transient-buttons-bottom
-          (make-button-list t styletab-c:right-bottom-buttons 'bottom-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
+         (right-normal-buttons-bottom 
+          (make-button-list nil styletab-c:right-bottom-buttons 'bottom-edge (+ (button-right-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (right-normal-buttons-bottom-s
+          (make-button-list nil styletab-c:right-bottom-buttons 'bottom-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom))))
          (right-transient-buttons-top
-          (make-button-list t styletab-c:right-top-buttons 'top-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom)))))
+          (make-button-list t styletab-c:right-top-buttons 'top-edge (+ (button-left-edge) styletab-c:borders-dimension)
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (right-transient-buttons-top-s
+          (make-button-list t styletab-c:right-top-buttons 'top-edge (button-left-edge) (+ styletab-c:title-dimension (button-width-custom))))
+         (right-transient-buttons-bottom
+          (make-button-list t styletab-c:right-bottom-buttons 'bottom-edge (+ (button-right-edge) styletab-c:borders-dimension) 
+                            (+ styletab-c:title-dimension (button-width-custom))))
+         (right-transient-buttons-bottom-s
+          (make-button-list t styletab-c:right-bottom-buttons 'bottom-edge (button-right-edge) (+ styletab-c:title-dimension (button-width-custom)))))
     
-    (let ((top-left-d-w 11)
-          (top-right-d-w (tabbar-right-edge-width))
-          (top-left-m (adjus top-normal-buttons-left))
-          (top-right-m (adjus top-normal-buttons-right))
-          (top-left-m-t (adjus top-transient-buttons-left))
-          (top-right-m-t (adjus top-transient-buttons-right))
-          (bottom-left-d-w 11)
-          (bottom-right-d-w (tabbar-right-edge-width))
-          (bottom-left-m (adjus bottom-normal-buttons-left))
-          (bottom-right-m (adjus bottom-normal-buttons-right))
-          (bottom-left-m-t (adjus bottom-transient-buttons-left))
-          (bottom-right-m-t (adjus bottom-transient-buttons-right))
-          (left-left-d-w 11)
-          (left-right-d-w (- styletab-c:title-dimension 2))
-          (left-left-m (adjus left-normal-buttons-bottom))
-          (left-right-m (adjus left-normal-buttons-top))
-          (left-left-m-t (adjus left-transient-buttons-bottom))
-          (left-right-m-t (adjus left-transient-buttons-top))
-          (right-left-d-w 11)
-          (right-right-d-w (- styletab-c:title-dimension 2))
-          (right-left-m (adjus right-normal-buttons-bottom))
-          (right-right-m (adjus right-normal-buttons-top))
-          (right-left-m-t (adjus right-transient-buttons-bottom))
-          (right-right-m-t (adjus right-transient-buttons-top)))
+    (table-set styletab-c-botton-cache "top-normal-buttons-left" top-normal-buttons-left)
+    (table-set styletab-c-botton-cache "top-normal-buttons-left-s" top-normal-buttons-left-s)
+    (table-set styletab-c-botton-cache "top-normal-buttons-right" top-normal-buttons-right)
+    (table-set styletab-c-botton-cache "top-normal-buttons-right-s" top-normal-buttons-right-s)
+    (table-set styletab-c-botton-cache "top-transient-buttons-left" top-transient-buttons-left)
+    (table-set styletab-c-botton-cache "top-transient-buttons-left-s" top-transient-buttons-left-s)
+    (table-set styletab-c-botton-cache "top-transient-buttons-right" top-transient-buttons-right)
+    (table-set styletab-c-botton-cache "top-transient-buttons-right-s" top-transient-buttons-right-s)
+    (table-set styletab-c-botton-cache "bottom-normal-buttons-left" bottom-normal-buttons-left)
+    (table-set styletab-c-botton-cache "bottom-normal-buttons-left-s" bottom-normal-buttons-left-s)
+    (table-set styletab-c-botton-cache "bottom-normal-buttons-right" bottom-normal-buttons-right)
+    (table-set styletab-c-botton-cache "bottom-normal-buttons-right-s" bottom-normal-buttons-right-s)
+    (table-set styletab-c-botton-cache "bottom-transient-buttons-left" bottom-transient-buttons-left)
+    (table-set styletab-c-botton-cache "bottom-transient-buttons-left-s" bottom-transient-buttons-left-s)
+    (table-set styletab-c-botton-cache "bottom-transient-buttons-right" bottom-transient-buttons-right)
+    (table-set styletab-c-botton-cache "bottom-transient-buttons-right-s" bottom-transient-buttons-right-s)
+    (table-set styletab-c-botton-cache "left-normal-buttons-top" left-normal-buttons-top)
+    (table-set styletab-c-botton-cache "left-normal-buttons-top-s" left-normal-buttons-top-s)
+    (table-set styletab-c-botton-cache "left-normal-buttons-bottom" left-normal-buttons-bottom)
+    (table-set styletab-c-botton-cache "left-normal-buttons-bottom-s" left-normal-buttons-bottom-s)
+    (table-set styletab-c-botton-cache "left-transient-buttons-top" left-transient-buttons-top)
+    (table-set styletab-c-botton-cache "left-transient-buttons-top-s" left-transient-buttons-top-s)
+    (table-set styletab-c-botton-cache "left-transient-buttons-bottom" left-transient-buttons-bottom)
+    (table-set styletab-c-botton-cache "left-transient-buttons-bottom-s" left-transient-buttons-bottom-s)
+    (table-set styletab-c-botton-cache "right-normal-buttons-top" right-normal-buttons-top)
+    (table-set styletab-c-botton-cache "right-normal-buttons-top-s" right-normal-buttons-top-s)
+    (table-set styletab-c-botton-cache "right-normal-buttons-bottom" right-normal-buttons-bottom)
+    (table-set styletab-c-botton-cache "right-normal-buttons-bottom-s" right-normal-buttons-bottom-s)
+    (table-set styletab-c-botton-cache "right-transient-buttons-top" right-transient-buttons-top)
+    (table-set styletab-c-botton-cache "right-transient-buttons-top-s" right-transient-buttons-top-s)
+    (table-set styletab-c-botton-cache "right-transient-buttons-bottom" right-transient-buttons-bottom)
+    (table-set styletab-c-botton-cache "right-transient-buttons-bottom-s" right-transient-buttons-bottom-s)))
 
-      (table-set styletab-botton-cache "top-normal-buttons-left" top-normal-buttons-left)
-      (table-set styletab-botton-cache "top-transient-buttons-left" top-transient-buttons-left)
-      (table-set styletab-botton-cache "top-normal-buttons-right" top-normal-buttons-right)
-      (table-set styletab-botton-cache "top-transient-buttons-right" top-transient-buttons-right)
-      (table-set styletab-botton-cache "top-tab-adjustments" 
-                 (list top-left-d-w top-right-d-w top-left-m top-right-m top-left-m-t top-right-m-t))
-      (table-set styletab-botton-cache "bottom-normal-buttons-left" bottom-normal-buttons-left)
-      (table-set styletab-botton-cache "bottom-transient-buttons-left" bottom-transient-buttons-left)
-      (table-set styletab-botton-cache "bottom-normal-buttons-right" bottom-normal-buttons-right)
-      (table-set styletab-botton-cache "bottom-transient-buttons-right" bottom-transient-buttons-right)
-      (table-set styletab-botton-cache "bottom-tab-adjustments"
-                 (list bottom-left-d-w bottom-right-d-w bottom-left-m bottom-right-m bottom-left-m-t bottom-right-m-t))
-      (table-set styletab-botton-cache "left-normal-buttons-top" left-normal-buttons-top)
-      (table-set styletab-botton-cache "left-transient-buttons-top" left-transient-buttons-top)
-      (table-set styletab-botton-cache "left-normal-buttons-bottom" left-normal-buttons-bottom)
-      (table-set styletab-botton-cache "left-transient-buttons-bottom" left-transient-buttons-bottom)
-      (table-set styletab-botton-cache "left-tab-adjustments" 
-                 (list left-left-d-w left-right-d-w left-left-m left-right-m left-left-m-t left-right-m-t))
-      (table-set styletab-botton-cache "right-normal-buttons-top" right-normal-buttons-top)
-      (table-set styletab-botton-cache "right-transient-buttons-top" right-transient-buttons-top)
-      (table-set styletab-botton-cache "right-normal-buttons-bottom" right-normal-buttons-bottom)
-      (table-set styletab-botton-cache "right-transient-buttons-bottom" right-transient-buttons-bottom)
-      (table-set styletab-botton-cache "right-tab-adjustments" 
-                 (list right-left-d-w right-right-d-w right-left-m right-right-m right-left-m-t right-right-m-t)))))
+(define (adjustments-tabbar w)
+  (let ((tab-adjustments (table-ref styletab-c-botton-cache w)))
+    (if (numberp (cdr (car (car tab-adjustments))))
+        (+ (cdr (car (car tab-adjustments))) (+ styletab-c:title-dimension (button-width-custom))) 0)))
 
-(define (make-frame)
+(define (check-sharped w)
+  (if (or (eq current-type 'shaped)
+          (eq current-type 'shaped-transient))
+      w (concat w "-s")))
+
+(define (make-frame w type current-title)
   (require 'sawfish.wm.tabs.tab)
   (when (eq current-title 'top)
     (update-title-x-offsets `(,(- styletab-c:title-dimension 12) . 0))
-    (setq top-tab-adjustments (table-ref styletab-botton-cache '"top-tab-adjustments"))
-    (set-tab-adjustments #:theme-left-dec-width (nth 0 top-tab-adjustments) #:theme-right-dec-width (nth 1 top-tab-adjustments)
-                         #:theme-left-margin (nth 2 top-tab-adjustments) #:theme-right-margin (nth 3 top-tab-adjustments)
-                         #:theme-left-margin-transient (nth 4 top-tab-adjustments) #:theme-right-margin-transient (nth 5 top-tab-adjustments))
-    (setq normal-frame
-          (append top-frame-title-group top-frame-default-border-corner-group (table-ref styletab-botton-cache '"top-normal-buttons-left")
-                  top-frame-border-group (table-ref styletab-botton-cache '"top-normal-buttons-right")))
-    (setq shaped-frame
-          (append top-frame-title-group top-frame-shaped-border-corner-group (table-ref styletab-botton-cache '"top-normal-buttons-left")
-                  (table-ref styletab-botton-cache '"top-normal-buttons-right")))
-    (setq transient-frame
-          (append top-frame-title-group top-frame-default-border-corner-group (table-ref styletab-botton-cache '"top-transient-buttons-left")
-                  top-frame-border-group (table-ref styletab-botton-cache '"top-transient-buttons-right")))
-    (setq shaped-transient-frame
-          (append top-frame-title-group top-frame-shaped-border-corner-group (table-ref styletab-botton-cache '"top-transient-buttons-left")
-                  (table-ref styletab-botton-cache '"top-transient-buttons-right"))))
+    (set-tab-adjustments #:theme-left-dec-width 11 #:theme-right-dec-width (tabbar-right-edge-width)
+                         #:theme-left-margin (adjustments-tabbar (check-sharped '"top-normal-buttons-left"))
+                         #:theme-right-margin (adjustments-tabbar (check-sharped '"top-normal-buttons-right"))
+                         #:theme-left-margin-transient (adjustments-tabbar (check-sharped '"top-transient-buttons-left"))
+                         #:theme-right-margin-transient (adjustments-tabbar (check-sharped '"top-transient-buttons-right")))
+    (when (eq type 'normal-frame)
+      (setq frame (append top-frame-title-group top-frame-default-border-corner-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"top-normal-buttons-left"))
+                          top-frame-border-group (table-ref styletab-c-botton-cache (check-sharped '"top-normal-buttons-right")))))
+    (when (eq type 'transient-frame)
+      (setq frame (append top-frame-title-group top-frame-default-border-corner-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"top-transient-buttons-left"))
+                          top-frame-border-group (table-ref styletab-c-botton-cache (check-sharped '"top-transient-buttons-right")))))
+    (when (eq type 'shaped-frame)
+      (setq frame (append top-frame-title-group top-frame-shaped-border-corner-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"top-normal-buttons-left"))
+                          (table-ref styletab-c-botton-cache (check-sharped '"top-normal-buttons-right")))))
+    (when (eq type 'shaped-transient-frame)
+      (setq frame (append top-frame-title-group top-frame-shaped-border-corner-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"top-transient-buttons-left"))
+                          (table-ref styletab-c-botton-cache (check-sharped '"top-transient-buttons-right"))))))
   
   (when (eq current-title 'bottom)
     (update-title-x-offsets `(,(- styletab-c:title-dimension 12) . 0))
-    (setq bottom-tab-adjustments (table-ref styletab-botton-cache '"bottom-tab-adjustments"))
-    (set-tab-adjustments #:theme-left-dec-width (nth 0 bottom-tab-adjustments) #:theme-right-dec-width (nth 1 bottom-tab-adjustments)
-                         #:theme-left-margin (nth 2 bottom-tab-adjustments) #:theme-right-margin (nth 3 bottom-tab-adjustments)
-                         #:theme-left-margin-transient (nth 4 bottom-tab-adjustments) #:theme-right-margin-transient (nth 5 bottom-tab-adjustments))
-    (setq normal-frame
-          (append bottom-frame-title-group bottom-frame-default-border-corner-group (table-ref styletab-botton-cache '"bottom-normal-buttons-left")
-                  bottom-frame-border-group (table-ref styletab-botton-cache '"bottom-normal-buttons-right")))
-    (setq shaped-frame
-          (append bottom-frame-title-group bottom-frame-shaped-border-corner-group (table-ref styletab-botton-cache '"bottom-normal-buttons-left")
-                  (table-ref styletab-botton-cache '"bottom-normal-buttons-right")))
-    (setq transient-frame
-          (append bottom-frame-title-group bottom-frame-default-border-corner-group (table-ref styletab-botton-cache '"bottom-transient-buttons-left")
-                  bottom-frame-border-group (table-ref styletab-botton-cache '"bottom-transient-buttons-right")))
-    (setq shaped-transient-frame
-          (append bottom-frame-title-group bottom-frame-shaped-border-corner-group (table-ref styletab-botton-cache '"bottom-transient-buttons-left")
-                  (table-ref styletab-botton-cache '"bottom-transient-buttons-right"))))
+    (set-tab-adjustments #:theme-left-dec-width 11 #:theme-right-dec-width (tabbar-right-edge-width)
+                         #:theme-left-margin (adjustments-tabbar (check-sharped '"bottom-normal-buttons-left"))
+                         #:theme-right-margin (adjustments-tabbar (check-sharped '"bottom-normal-buttons-right"))
+                         #:theme-left-margin-transient (adjustments-tabbar (check-sharped '"bottom-transient-buttons-left"))
+                         #:theme-right-margin-transient (adjustments-tabbar (check-sharped '"bottom-transient-buttons-right")))
+    (when (eq type 'normal-frame)
+      (setq frame (append bottom-frame-title-group bottom-frame-default-border-corner-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"bottom-normal-buttons-left"))
+                          bottom-frame-border-group (table-ref styletab-c-botton-cache (check-sharped '"bottom-normal-buttons-right")))))
+    (when (eq type 'transient-frame)
+      (setq frame (append bottom-frame-title-group bottom-frame-default-border-corner-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"bottom-transient-buttons-left"))
+                          bottom-frame-border-group (table-ref styletab-c-botton-cache (check-sharped '"bottom-transient-buttons-right")))))
+    (when (eq type 'shaped-frame)
+      (setq frame (append bottom-frame-title-group bottom-frame-shaped-border-corner-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"bottom-normal-buttons-left"))
+                          (table-ref styletab-c-botton-cache (check-sharped '"bottom-normal-buttons-right")))))
+    (when (eq type 'shaped-transient-frame)
+      (setq frame (append bottom-frame-title-group bottom-frame-shaped-border-corner-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"bottom-transient-buttons-left"))
+                          (table-ref styletab-c-botton-cache (check-sharped '"bottom-transient-buttons-right"))))))
   
   (when (eq current-title 'left)
     (update-title-x-offsets '(11 . -11))
-    (setq left-tab-adjustments (table-ref styletab-botton-cache '"left-tab-adjustments"))
-    (set-tab-adjustments #:theme-left-dec-width (nth 0 left-tab-adjustments) #:theme-right-dec-width (nth 1 left-tab-adjustments)
-                         #:theme-left-margin (nth 2 left-tab-adjustments) #:theme-right-margin (nth 3 left-tab-adjustments)
-                         #:theme-left-margin-transient (nth 4 left-tab-adjustments) #:theme-right-margin-transient (nth 5 left-tab-adjustments))
-    (setq normal-frame
-          (append left-frame-title-group (table-ref styletab-botton-cache '"left-normal-buttons-bottom") left-frame-default-border-corner-group
-                  left-frame-border-group (table-ref styletab-botton-cache '"left-normal-buttons-top")))
-    (setq shaped-frame
-          (append left-frame-title-group (table-ref styletab-botton-cache '"left-normal-buttons-bottom") left-frame-shaped-border-corner-group
-                  (table-ref styletab-botton-cache '"left-normal-buttons-top")))
-    (setq transient-frame
-          (append left-frame-title-group (table-ref styletab-botton-cache '"left-transient-buttons-bottom") left-frame-default-border-corner-group
-                  left-frame-border-group (table-ref styletab-botton-cache '"left-transient-buttons-top")))
-    (setq shaped-transient-frame
-          (append left-frame-title-group (table-ref styletab-botton-cache '"left-transient-buttons-bottom") left-frame-shaped-border-corner-group
-                  (table-ref styletab-botton-cache '"left-transient-buttons-top"))))
+    (set-tab-adjustments #:theme-left-dec-width 11 #:theme-right-dec-width (- styletab-c:title-dimension 2)
+                         #:theme-left-margin (adjustments-tabbar (check-sharped '"left-normal-buttons-bottom"))
+                         #:theme-right-margin (adjustments-tabbar (check-sharped '"left-normal-buttons-top"))
+                         #:theme-left-margin-transient (adjustments-tabbar (check-sharped '"left-transient-buttons-bottom"))
+                         #:theme-right-margin-transient (adjustments-tabbar (check-sharped '"left-transient-buttons-top")))
+    (when (eq type 'normal-frame)
+      (setq frame (append left-frame-title-group (table-ref styletab-c-botton-cache (check-sharped '"left-normal-buttons-bottom"))
+                          left-frame-default-border-corner-group left-frame-border-group 
+                          (table-ref styletab-c-botton-cache (check-sharped '"left-normal-buttons-top")))))
+    (when (eq type 'transient-frame)
+      (setq frame (append left-frame-title-group (table-ref styletab-c-botton-cache (check-sharped '"left-transient-buttons-bottom")) 
+                          left-frame-default-border-corner-group 
+                          left-frame-border-group (table-ref styletab-c-botton-cache (check-sharped '"left-transient-buttons-top")))))
+    (when (eq type 'shaped-frame)
+      (setq frame (append left-frame-title-group (table-ref styletab-c-botton-cache (check-sharped '"left-normal-buttons-bottom"))
+                          left-frame-shaped-border-corner-group (table-ref styletab-c-botton-cache (check-sharped '"left-normal-buttons-top")))))
+    (when (eq type 'shaped-transient-frame)
+      (setq frame (append left-frame-title-group (table-ref styletab-c-botton-cache (check-sharped '"left-transient-buttons-bottom"))
+                          left-frame-shaped-border-corner-group (table-ref styletab-c-botton-cache (check-sharped '"left-transient-buttons-top"))))))
   
   (when (eq current-title 'right)
     (update-title-x-offsets '(11 . -11))
-    (setq right-tab-adjustments (table-ref styletab-botton-cache '"right-tab-adjustments"))
-    (set-tab-adjustments #:theme-left-dec-width (nth 0 right-tab-adjustments) #:theme-right-dec-width (nth 1 right-tab-adjustments)
-                         #:theme-left-margin (nth 2 right-tab-adjustments) #:theme-right-margin (nth 3 right-tab-adjustments)
-                         #:theme-left-margin-transient (nth 4 right-tab-adjustments) #:theme-right-margin-transient (nth 5 right-tab-adjustments))
-    (setq normal-frame
-          (append right-frame-title-group (table-ref styletab-botton-cache '"right-normal-buttons-bottom") right-frame-default-border-corner-group
-                  right-frame-border-group (table-ref styletab-botton-cache '"right-normal-buttons-top")))
-    (setq shaped-frame
-          (append right-frame-title-group (table-ref styletab-botton-cache '"right-normal-buttons-bottom") right-frame-shaped-border-corner-group
-                  (table-ref styletab-botton-cache '"right-normal-buttons-top")))
-    (setq transient-frame
-          (append right-frame-title-group (table-ref styletab-botton-cache '"right-transient-buttons-bottom") right-frame-default-border-corner-group
-                  right-frame-border-group (table-ref styletab-botton-cache '"right-transient-buttons-top")))
-    (setq shaped-transient-frame
-          (append right-frame-title-group (table-ref styletab-botton-cache '"right-transient-buttons-bottom") right-frame-shaped-border-corner-group
-                  (table-ref styletab-botton-cache '"right-transient-buttons-top")))))
-
-(define (current-title-w w)
-  (if (not (window-get w 'title-position))
-      (case styletab-c:titlebar-place
-            ((top) (setq current-title 'top))
-            ((bottom) (setq current-title 'bottom))
-            ((left) (setq current-title 'left))
-            ((right) (setq current-title 'right)))
-    (setq current-title (window-get w 'title-position)))
-  (make-frame))
-
-(define (create-frames-only w)
-  (when (eq (window-get w 'current-frame-style) theme-name)
-    (current-title-w w)))
+    (set-tab-adjustments #:theme-left-dec-width 11 #:theme-right-dec-width (- styletab-c:title-dimension 2)
+                         #:theme-left-margin (adjustments-tabbar (check-sharped '"right-normal-buttons-bottom"))
+                         #:theme-right-margin (adjustments-tabbar (check-sharped '"right-normal-buttons-top"))
+                         #:theme-left-margin-transient (adjustments-tabbar (check-sharped '"right-transient-buttons-bottom"))
+                         #:theme-right-margin-transient (adjustments-tabbar (check-sharped '"right-transient-buttons-top")))
+    (when (eq type 'normal-frame)
+      (setq frame (append right-frame-title-group (table-ref styletab-c-botton-cache (check-sharped '"right-normal-buttons-bottom")) 
+                          right-frame-default-border-corner-group
+                          right-frame-border-group (table-ref styletab-c-botton-cache (check-sharped '"right-normal-buttons-top")))))
+    (when (eq type 'transient-frame)
+      (setq frame (append right-frame-title-group (table-ref styletab-c-botton-cache (check-sharped '"right-transient-buttons-bottom")) 
+                          right-frame-default-border-corner-group
+                          right-frame-border-group (table-ref styletab-c-botton-cache (check-sharped '"right-transient-buttons-top")))))
+    (when (eq type 'shaped-frame)
+      (setq frame (append right-frame-title-group (table-ref styletab-c-botton-cache (check-sharped '"right-normal-buttons-bottom"))
+                          right-frame-shaped-border-corner-group
+                          (table-ref styletab-c-botton-cache (check-sharped '"right-normal-buttons-top")))))
+    (when (eq type 'shaped-transient-frame)
+      (setq frame (append right-frame-title-group (table-ref styletab-c-botton-cache (check-sharped '"right-transient-buttons-bottom")) 
+                          right-frame-shaped-border-corner-group
+                          (table-ref styletab-c-botton-cache (check-sharped '"right-transient-buttons-top"))))))
+  frame)
 
-(define (reframe-windows style)
-  (map-windows
-   (lambda (w)
-     (when (eq (window-get w 'current-frame-style) style)
-       (current-title-w w)
-       (reframe-window w)))))
+(define (make-buttons-reframe-with-style)
+  (make-buttons) 
+  (reframe-windows-with-style theme-name))
 
-(define (reframe-buttons)
-  (make-buttons)
-  (reframe-windows theme-name))
+(define (reframe-with-style)
+  (reframe-windows-with-style theme-name))
 
-(define (reframe-all)
-  (make-frame)
-  (reframe-windows theme-name))
+(define (rebuild-one w)
+  (when (not (window-get w 'tabbed))
+    (when (eq (window-get w 'current-frame-style) theme-name)
+      (rebuild-frame w))))
 
 (define (reframe-one w)
   (when (not (window-get w 'tabbed))
     (when (eq (window-get w 'current-frame-style) theme-name)
-      (current-title-w w)
-      (rebuild-frame w))))
+      (reframe-window w))))
 
-;; reframe-all and reset icon cache
+;; reframe-with-style, resize bottons
+;; reset icon cache
 (define (clear-icon-cache-reframe)
   (when recolor-lock
     (setq recolor-lock nil)
-    (make-buttons)
     (recolor-all-buttons)
-    (setq styletab-icon-cache (make-weak-table eq-hash eq))
-    (reframe-all)
+    (setq styletab-c-icon-cache (make-weak-table eq-hash eq))
+    (make-buttons) 
+    (reframe-with-style)
     (setq recolor-lock t)))
 
-(define (bright-changed)
+(define (color-changed)
   (when recolor-lock
     (setq recolor-lock nil)
-    (recolor-tab)
-    (recolor-all-buttons)
-    (reframe-windows-with-style theme-name)
+    (recolor-all)
+    (reframe-with-style)
     (setq recolor-lock t)))
 
-(define (color-changed)
+(define (bright-changed)
   (when recolor-lock
     (setq recolor-lock nil)
-    (recolor-all)
-    (reframe-windows-with-style theme-name)
+    (recolor-tab)
+    (recolor-all-buttons)
+    (reframe-with-style)
     (setq recolor-lock t)))
 
 (define (botton-color-changed botton)
   (when recolor-lock
     (setq recolor-lock nil)
     (botton)
-    (reframe-windows theme-name)
+    (reframe-with-style)
     (setq recolor-lock t)))
 
-;; At last! We create the actual theme
-(add-frame-style theme-name
-                 (lambda (w type)
-                   (case type
-                         ((default)             normal-frame)
-                         ((shaped)              shaped-frame)
-                         ((transient)           transient-frame)
-                         ((shaped-transient)    shaped-transient-frame)
-                         ((utility)             normal-frame)
-                         ((shaded-utility)      normal-frame)
-                         ((unframed)            nil-frame))))
+(define (reload-frame-style-reframe)
+  (reload-frame-style theme-name)
+  (reframe-with-style))
 
-(define (initialize-theme)
-  (when recolor-cache
-    (setq recolor-cache nil)
-    (recolor-all)
-    (setq recolor-cache t)
-    (make-buttons)
-    (make-frame)
-    (color-changed)))
+(define (get-frame w type)
+  (setq current-type (window-get w 'type))
+  (let ((current-title 
+         (if (not (window-get w 'title-position))
+             (case styletab-c:titlebar-place
+                   ((top)    'top)
+                   ((bottom) 'bottom)
+                   ((left)   'left)
+                   ((right)  'right))
+           (window-get w 'title-position))))
+    (case type
+          ((default)
+           (make-frame w 'normal-frame current-title))
+          ((utility)
+           (make-frame w 'normal-frame current-title))
+          ((shaded-utility)
+           (make-frame w 'normal-frame current-title))
+          ((transient)
+           (make-frame w 'transient-frame current-title))
+          ((shaped)
+           (make-frame w 'shaped-frame current-title))
+          ((shaped-transient)
+           (make-frame w 'shaped-transient-frame current-title)))))
 
-(initialize-theme)
+(add-frame-style theme-name get-frame)
 
-(call-after-state-changed '(sticky fixed-position stacking maximized) reframe-one)
-(call-after-state-changed '(title-position) create-frames-only)
-(add-hook 'remove-from-workspace-hook reframe-one)
+;; initialize theme
+(make-buttons) 
+(color-changed)
 
+(call-after-state-changed '(sticky fixed-position stacking) rebuild-one)
+(call-after-state-changed '(maximized) reframe-one)
+(add-hook 'remove-from-workspace-hook rebuild-one)
+
+(custom-set-property 'styletab-c:styles ':after-set reload-frame-style-reframe)
 (custom-set-property 'styletab-c:title-dimension ':after-set clear-icon-cache-reframe)
 (custom-set-property 'styletab-c:custom-button-width ':after-set clear-icon-cache-reframe)
 (custom-set-property 'styletab-c:button-width ':after-set clear-icon-cache-reframe)
-(custom-set-property 'styletab-c:borders-dimension ':after-set reframe-all)
-(custom-set-property 'styletab-c:titlebar-place ':after-set reframe-all)
-(custom-set-property 'styletab-c:top-left-buttons ':after-set reframe-buttons)
-(custom-set-property 'styletab-c:top-right-buttons ':after-set reframe-buttons)
-(custom-set-property 'styletab-c:bottom-left-buttons ':after-set reframe-buttons)
-(custom-set-property 'styletab-c:bottom-right-buttons ':after-set reframe-buttons)
-(custom-set-property 'styletab-c:left-top-buttons ':after-set reframe-buttons)
-(custom-set-property 'styletab-c:left-bottom-buttons ':after-set reframe-buttons)
-(custom-set-property 'styletab-c:right-top-buttons ':after-set reframe-buttons)
-(custom-set-property 'styletab-c:right-bottom-buttons ':after-set reframe-buttons)
+(custom-set-property 'styletab-c:borders-dimension ':after-set make-buttons-reframe-with-style)
+(custom-set-property 'styletab-c:titlebar-place ':after-set reframe-with-style)
+(custom-set-property 'styletab-c:top-left-buttons ':after-set make-buttons-reframe-with-style)
+(custom-set-property 'styletab-c:top-right-buttons ':after-set make-buttons-reframe-with-style)
+(custom-set-property 'styletab-c:bottom-left-buttons ':after-set make-buttons-reframe-with-style)
+(custom-set-property 'styletab-c:bottom-right-buttons ':after-set make-buttons-reframe-with-style)
+(custom-set-property 'styletab-c:left-top-buttons ':after-set make-buttons-reframe-with-style)
+(custom-set-property 'styletab-c:left-bottom-buttons ':after-set make-buttons-reframe-with-style)
+(custom-set-property 'styletab-c:right-top-buttons ':after-set make-buttons-reframe-with-style)
+(custom-set-property 'styletab-c:right-bottom-buttons ':after-set make-buttons-reframe-with-style)

Attachment: signature.asc
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/