set-tab-adjustments (was: Themes for 3.0)



so here is the promised patch. It's working when calling via RC or sawfish-client,
haven't yet tested calling from a theme.

example invocation:

(set-tab-adjustments #:left-dec 11 #:right-dec 11 #:left-margin 160 #:right-margin 160 #:left-margin-transient 160 #:right-margin-transient 160)

Regards,
Chris
diff --git a/lisp/sawfish/wm/tabs/tab.jl b/lisp/sawfish/wm/tabs/tab.jl
index cf833f1..29171d0 100644
--- a/lisp/sawfish/wm/tabs/tab.jl
+++ b/lisp/sawfish/wm/tabs/tab.jl
@@ -20,8 +20,9 @@
 
 (define-structure sawfish.wm.tabs.tab
 
-	(export tab-add-to-group 
-            raise-tabs-on-hover-setter)
+	(export tab-add-to-group
+                raise-tabs-on-hover-setter
+		set-tab-adjustments)
 
 	(open rep
 	      rep.system
@@ -32,7 +33,8 @@
 	      sawfish.wm.tabs.tabgroup
 	      sawfish.wm.util.marks
 	      sawfish.wm.windows
-	      sawfish.wm.stacking)
+	      sawfish.wm.stacking
+	      sawfish.wm.gaol)
 
      (define-structure-alias tab sawfish.wm.tabs.tab)
 
@@ -46,37 +48,23 @@
 
   (defgroup tabs "Tabs")
 
-  (defcustom tab-left-dec-width 11 "Width of tab's left-edge decoration"
-    :group tabs
-    :type number
-    :after-set reframe-all-windows)
-
-  (defcustom tab-right-dec-width 11 "Width of tab's right-edge decoration"
-    :group tabs
-    :type number
-    :after-set reframe-all-windows)
-
-  (defcustom tab-left-margin 66 "Width of tab area's left-edge decoration"
-    :group tabs
-    :type number
-    :after-set reframe-all-windows)
-
-  (defcustom tab-right-margin 68 "Width of tab area's right-edge decoration"
-    :group tabs
-    :type number
-    :after-set reframe-all-windows)
-
-  (defcustom tab-left-margin-transient 44 "Width of tab area's left-edge-transient decoration"
-    :group tabs
-    :type number
-    :after-set reframe-all-windows)
-
-  (defcustom tab-right-margin-transient 24 "Width of tab area's right-edge-transient decoration"
-    :group tabs
-    :type number
-    :after-set reframe-all-windows)
-
-  (defcustom tab-raise-on-hover nil 
+  (define (set-tab-adjustments #!key left-dec right-dec left-margin right-margin left-margin-transient right-margin-transient)
+    (if left-dec
+        (defvar-setq tab-left-dec-width left-dec))
+    (if right-dec
+	(defvar-setq tab-right-dec-width right-dec))
+    (if left-margin
+	(defvar-setq tab-left-margin left-margin))
+    (if right-margin
+        (defvar-setq tab-right-margin right-margin))
+    (if left-margin-transient
+        (defvar-setq tab-left-margin-transient left-margin-transient))
+    (if right-margin-transient
+        (defvar-setq tab-right-margin-transient right-margin-transient)))
+
+  (gaol-add set-tab-adjustments)
+
+  (defcustom tab-raise-on-hover nil
     "Raise Tabs on Hover"
     :group tabs
     :type boolean
@@ -155,9 +143,9 @@
            (margin-l (nth 2 (get-tab-pos win)))
            (dim-y (nth 1 (get-tab-pos win))))
       (when (> dim-y margin-l) ;; don't display outside from frame
-       ;; use double size for icon support 
+       ;; use double size for icon support
        (+ top margin-l (- (* tab-right-dec-width 2))))))
-  
+
   (define (tab-title-left-edge win)
     "Compute left edge of tab"
     (+ (tab-left-edge win) tab-left-dec-width))
@@ -185,7 +173,7 @@
       (height . ,tab-title-text-height)))
 
   (set-frame-part-value 'tab-s 'keymap 'title-keymap)
-  
+
   (define-frame-class 'tab-l
     `((cursor . left_ptr)
       (left-edge . ,tab-left-edge)) t)
@@ -194,7 +182,7 @@
   (define-frame-class 'tab-ls
     `((cursor . left_ptr)
       (bottom-edge . ,tab-bottom-edge)) t)
-  
+
   (define-frame-class 'tab-r
     `((cursor . left_ptr)
   (left-edge . ,tab-right-dec-pos)) t)
@@ -203,7 +191,7 @@
   (define-frame-class 'tab-rs
     `((cursor . left_ptr)
       (bottom-edge . ,tab-top-dec-pos)) t)
-  
+
   (define (mygroup win)
     (if (marked-windows)
         (progn


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]