[sawfish/tabs-ng] began rework of tabs (ChangeLog/NEWS follow)
- From: Christopher Bratusek <chrisb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sawfish/tabs-ng] began rework of tabs (ChangeLog/NEWS follow)
- Date: Thu, 4 Nov 2010 17:32:44 +0000 (UTC)
commit ef269d56bf1dd22b44143109eb4c8b003c096714
Author: Christopher Roy Bratusek <zanghar freenet de>
Date: Thu Nov 4 18:27:58 2010 +0100
began rework of tabs (ChangeLog/NEWS follow)
lisp/sawfish/wm/autoload.jl | 1 -
lisp/sawfish/wm/ext/match-window.jl | 1 +
lisp/sawfish/wm/ext/window-history.jl | 2 +-
lisp/sawfish/wm/focus.jl | 19 +-
lisp/sawfish/wm/frames.jl | 6 +
lisp/sawfish/wm/gaol.jl | 1 +
lisp/sawfish/wm/keymaps.jl | 11 +
lisp/sawfish/wm/tabs/tab.jl | 176 +++----
lisp/sawfish/wm/tabs/tabgroup.jl | 94 ++--
themes/Elberg-tabbed/theme.jl | 942 ++++++++++++++++++---------------
themes/get-S-tabbed/theme.jl | 665 ++++++++++++-----------
11 files changed, 1017 insertions(+), 901 deletions(-)
---
diff --git a/lisp/sawfish/wm/autoload.jl b/lisp/sawfish/wm/autoload.jl
index 17122ad..8f13529 100644
--- a/lisp/sawfish/wm/autoload.jl
+++ b/lisp/sawfish/wm/autoload.jl
@@ -128,7 +128,6 @@
(autoload-command 'slide-group-down 'sawfish.wm.commands.slide-window)
(defgroup gpsy "Grow, Pack, Shrink & Yank" :group move :require sawfish.wm.commands.grow-pack)
(defgroup cycle "Window Cycling" :group focus :require sawfish.wm.commands.x-cycle)
-(defgroup tabs "Tabs" :require sawfish.wm.tabs.tab)
(autoload-command 'cycle-windows 'sawfish.wm.commands.x-cycle)
(autoload-command 'cycle-windows-backwards 'sawfish.wm.commands.x-cycle)
(autoload-command 'cycle-group 'sawfish.wm.commands.x-cycle)
diff --git a/lisp/sawfish/wm/ext/match-window.jl b/lisp/sawfish/wm/ext/match-window.jl
index bc64cdc..cde350a 100644
--- a/lisp/sawfish/wm/ext/match-window.jl
+++ b/lisp/sawfish/wm/ext/match-window.jl
@@ -92,6 +92,7 @@
`(choice ,@(mapcar car match-window-types))))
(frame-style ,(lambda ()
`(symbol ,@(find-all-frame-styles t))))
+ (title-position (choice top bottom right left))
(dimensions (pair (number 1) (number 1)))
(maximized (choice all vertical horizontal
fullscreen full-xinerama))
diff --git a/lisp/sawfish/wm/ext/window-history.jl b/lisp/sawfish/wm/ext/window-history.jl
index 4746f00..d1df38f 100644
--- a/lisp/sawfish/wm/ext/window-history.jl
+++ b/lisp/sawfish/wm/ext/window-history.jl
@@ -74,7 +74,7 @@
;; list of states in window-state-change-hook that should be tracked
(defvar window-history-states '(sticky ignored never-focus type maximized
frame-style cycle-skip
- window-list-skip))
+ window-list-skip title-position))
;; property matched on
(defvar window-history-key-property '(WM_CLASS WM_WINDOW_ROLE))
diff --git a/lisp/sawfish/wm/focus.jl b/lisp/sawfish/wm/focus.jl
index 55449fd..fac4776 100644
--- a/lisp/sawfish/wm/focus.jl
+++ b/lisp/sawfish/wm/focus.jl
@@ -23,11 +23,12 @@
(export define-focus-mode
autoload-focus-mode
focus-mode
+ raise-tabs-on-hover-setter
set-focus-mode
focus-push-map
focus-pop-map
warp-pointer-if-necessary
- focus-revert
+ focus-revert
focus-within-click-event)
(open rep
@@ -51,6 +52,12 @@
:before-set (lambda () (focus-mode-changed 'before))
:after-set (lambda () (focus-mode-changed 'after)))
+ (defcustom tab-raise-on-hover nil
+ "Raise tabs on hover"
+ :group focus
+ :type boolean
+ :after-set (lambda () (raise-tabs-on-hover-setter)))
+
(defcustom focus-click-through t
"Click-to-focus mode passes the click through to the application."
:type boolean
@@ -209,6 +216,16 @@ EVENT-NAME)', where EVENT-NAME may be one of the following symbols:
(window-really-wants-input-p w))
(set-input-focus w))))))
+ (define (raise-tabs-on-hover-action w)
+ (require 'sawfish.wm.stacking)
+ (raise-window w))
+
+ (define (raise-tabs-on-hover-setter)
+ (if (eq tab-raise-on-hover 't)
+ (add-hook 'enter-frame-part-hook raise-tabs-on-hover-action)
+ (when (add-hook 'enter-frame-part-hook raise-tabs-on-hover-action)
+ (remove-hook 'enter-frame-part-hook raise-tabs-on-hover-action))))
+
(define (focus-click)
(let ((w (current-event-window))
(event (current-event)))
diff --git a/lisp/sawfish/wm/frames.jl b/lisp/sawfish/wm/frames.jl
index fb0fa89..724a7b9 100644
--- a/lisp/sawfish/wm/frames.jl
+++ b/lisp/sawfish/wm/frames.jl
@@ -659,6 +659,12 @@ generate.")
(define-frame-class 'title `((keymap . title-keymap)
(cursor . ,(cursor-for-frame-part 'title))))
+ (define-frame-class 'tabbar-horizontal `((keymap . tabbar-keymap)
+ (cursor . ,(cursor-for-frame-part 'title))))
+
+ (define-frame-class 'tabbar-vertical `((keymap . tabbar-keymap)
+ (cursor . ,(cursor-for-frame-part 'title))))
+
(mapc (lambda (x)
(define-frame-class x `((cursor . ,(cursor-for-frame-part x))
(keymap . border-keymap))))
diff --git a/lisp/sawfish/wm/gaol.jl b/lisp/sawfish/wm/gaol.jl
index 731ed98..daad892 100644
--- a/lisp/sawfish/wm/gaol.jl
+++ b/lisp/sawfish/wm/gaol.jl
@@ -71,6 +71,7 @@
sawfish.wm.util.gradient
sawfish.wm.util.recolor-image
sawfish.wm.theming.make-theme
+ sawfish.wm.tabs.tab
;; compatibility
timers gradient make-theme))
diff --git a/lisp/sawfish/wm/keymaps.jl b/lisp/sawfish/wm/keymaps.jl
index 32552ee..cc31f44 100644
--- a/lisp/sawfish/wm/keymaps.jl
+++ b/lisp/sawfish/wm/keymaps.jl
@@ -126,6 +126,17 @@ a window. (Only mouse-bindings are evaluated in this map.)"
:group bindings
:type keymap)
+ (defcustom tabbar-keymap (bind-keys (make-keymap)
+ "Button1-Off2" 'toggle-window-shaded
+ "Button1-Move" 'move-window-interactively
+ "C-Button1-Off" 'tab-add-to-group
+ "C-Button1-Click" 'tab-release-window
+ "C-Button1-Move" 'move-window-interactively)
+ "Keymap containing bindings active when the pointer is in the tabbar of
+a window. (Only mouse-bindings are evaluated in this map.)"
+ :group bindings
+ :type keymap)
+
(defcustom border-keymap (bind-keys (make-keymap)
"Button3-Off" 'raise-lower-window
"Button2-Move" 'move-window-interactively
diff --git a/lisp/sawfish/wm/tabs/tab.jl b/lisp/sawfish/wm/tabs/tab.jl
index cf833f1..7f91e4b 100644
--- a/lisp/sawfish/wm/tabs/tab.jl
+++ b/lisp/sawfish/wm/tabs/tab.jl
@@ -21,7 +21,7 @@
(define-structure sawfish.wm.tabs.tab
(export tab-add-to-group
- raise-tabs-on-hover-setter)
+ set-tab-adjustments)
(open rep
rep.system
@@ -32,9 +32,9 @@
sawfish.wm.tabs.tabgroup
sawfish.wm.util.marks
sawfish.wm.windows
- sawfish.wm.stacking)
+ sawfish.wm.gaol)
- (define-structure-alias tab sawfish.wm.tabs.tab)
+ (define-structure-alias tab sawfish.wm.tabs.tab)
;; TODO:
;; - change other tab sizes when window resizes itself, should fixed
@@ -42,45 +42,22 @@
;; - hide some frame parts on leftmost and rightmost tabs, should fixed
;; - add a drag-n-drop way to group windows by tabs
- ;;###autoload (defgroup tabs "Tabs")
-
- (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
- "Raise Tabs on Hover"
- :group tabs
- :type boolean
- :after-set (lambda () (raise-tabs-on-hover-setter)))
+ (define (set-tab-adjustments #!key theme-left-dec-width theme-right-dec-width theme-left-margin
+ theme-right-margin theme-left-margin-transient theme-right-margin-transient)
+ (if theme-left-dec-width
+ (defvar-setq tabbar-left-dec-width theme-left-dec-width))
+ (if theme-right-dec-width
+ (defvar-setq tabbar-right-dec-width theme-right-dec-width))
+ (if theme-left-margin
+ (defvar-setq tabbar-left-margin theme-left-margin))
+ (if theme-right-margin
+ (defvar-setq tabbar-right-margin theme-right-margin))
+ (if theme-left-margin-transient
+ (defvar-setq tabbar-left-margin-transient theme-left-margin-transient))
+ (if theme-right-margin-transient
+ (defvar-setq tabbar-right-margin-transient theme-right-margin-transient)))
+
+ (gaol-add set-tab-adjustments)
(define (get-tab-pos win)
(let* ((group (tab-find-window win))
@@ -94,13 +71,13 @@
(margin-l
(if (or (eq (window-get win 'type) 'transient)
(eq (window-get win 'type) 'shaped-transient))
- tab-left-margin-transient
- tab-left-margin))
+ tabbar-left-margin-transient
+ tabbar-left-margin))
(margin-r
(if (or (eq (window-get win 'type) 'transient)
(eq (window-get win 'type) 'shaped-transient))
- tab-right-margin-transient
- tab-right-margin))
+ tabbar-right-margin-transient
+ tabbar-right-margin))
(tabarea-width (- dim-x margin-l margin-r))
(tabarea-height (- dim-y margin-l margin-r))
(numtabs (length (tab-group-window-list group)))
@@ -108,6 +85,7 @@
(bottom (quotient (* tabnum tabarea-height) numtabs))
;; the right edge is not always "left + (window-width / numtabs)"
;; that would be inaccurate due to rounding errors
+ ;;
(right (quotient (* (+ tabnum 1) tabarea-width) numtabs))
(top (quotient (* (+ tabnum 1) tabarea-height) numtabs))
(width (- right left))
@@ -115,111 +93,89 @@
(list dim-x dim-y margin-l margin-r left right width bottom top height)))
(define (tab-title-text-width win)
- "Width of the title text area is the tabwidth minus decorations"
+ "Width of the title text area is the tabwidth minus decorations by horizontal titlebar themes"
(let* ((tabwidth (nth 6 (get-tab-pos win))))
- (+ tabwidth
- (- tab-left-dec-width)
- (- tab-right-dec-width))))
+ (+ tabwidth
+ (- tabbar-left-dec-width)
+ (- tabbar-right-dec-width))))
(define (tab-title-text-height win)
- "Height of the title text area is the tabheight minus decorations by a left or right titlebar themes"
+ "Height of the title text area is the tabheight minus decorations by vertical titlebar themes"
(let* ((tabheight (nth 9 (get-tab-pos win))))
(when (> tabheight 0)
(+ tabheight
- (- tab-left-dec-width)
- (- tab-right-dec-width)))))
+ (- tabbar-left-dec-width)
+ (- tabbar-right-dec-width)))))
(define (tab-left-edge win)
- "Compute left edge of tab"
+ "Compute left edge of tab by horizontal titlebar themes"
(let* ((left (nth 4 (get-tab-pos win)))
(margin-l (nth 2 (get-tab-pos win))))
- (+ left margin-l)))
+ (+ left margin-l)))
(define (tab-bottom-edge win)
- "Compute bottom edge of tab by a left or right titlebar themes"
+ "Compute bottom edge of tab by vertical titlebar themes"
(let* ((bottom (nth 7 (get-tab-pos win)))
(margin-l (nth 2 (get-tab-pos win))))
- (+ bottom margin-l)))
+ (+ bottom margin-l)))
(define (tab-right-dec-pos win)
- "Compute position of tab's right-edge decoration"
+ "Compute position of tab's right-edge decoration by horizontal titlebar themes"
(let* ((right (nth 5 (get-tab-pos win)))
(margin-l (nth 2 (get-tab-pos win)))
(dim-x (nth 0 (get-tab-pos win))))
(when (> dim-x margin-l) ;; don't display outside from frame
- (+ right margin-l (- tab-right-dec-width)))))
+ (+ right margin-l (- tabbar-right-dec-width)))))
(define (tab-top-dec-pos win)
- "Compute position of tab's top-edge decoration by a left or right titlebar themes"
+ "Compute position of tab's top-edge decoration by vertical titlebar themes"
(let* ((top (nth 8 (get-tab-pos win)))
(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
- (+ top margin-l (- (* tab-right-dec-width 2))))))
-
+ ;; use double size for icon support
+ (+ top margin-l (- (* tabbar-right-dec-width 2))))))
+
(define (tab-title-left-edge win)
- "Compute left edge of tab"
- (+ (tab-left-edge win) tab-left-dec-width))
+ "Compute left edge of tab by horizontal titlebar themes"
+ (+ (tab-left-edge win) tabbar-left-dec-width))
(define (tab-title-bottom-edge win)
- "Compute bottom edge of tab by a left or right titlebar themes"
- (+ (tab-bottom-edge win) tab-left-dec-width))
-
- ;; new class : tab
- (define-frame-class 'tab
- `((cursor . left_ptr)
- (x-justify . 12)
- (y-justify . center)
- (left-edge . ,tab-title-left-edge)
+ "Compute bottom edge of tab by vertical titlebar themes"
+ (+ (tab-bottom-edge win) tabbar-left-dec-width))
+
+ ;; new classes tabs : tabbar-horizontal-left-edge tabbar-horizontal tabbar-horizontal-right-edge
+ ;;
+ (define-frame-class 'tabbar-horizontal-left-edge
+ `((left-edge . ,tab-left-edge)) t)
+
+ (define-frame-class 'tabbar-horizontal
+ `((left-edge . ,tab-title-left-edge)
(width . ,tab-title-text-width)))
- (set-frame-part-value 'tab 'keymap 'title-keymap)
+ (define-frame-class 'tabbar-horizontal-right-edge
+ `((left-edge . ,tab-right-dec-pos)) t)
+
+ ;; new classes tabs on side : tabbar-vertical-top-edge tabbar-vertical tabbar-vertical-bottom-edge
+ ;;
+ (define-frame-class 'tabbar-vertical-top-edge
+ `((bottom-edge . ,tab-top-dec-pos)) t)
- ;; side tab arena
- (define-frame-class 'tab-s
- `((cursor . left_ptr)
- (x-justify . 12)
- (y-justify . center)
- (bottom-edge . ,tab-title-bottom-edge)
+ (define-frame-class 'tabbar-vertical
+ `((bottom-edge . ,tab-title-bottom-edge)
(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)
-
- ;; side tab arena bottom end
- (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)
-
- ;; side tab arena top end
- (define-frame-class 'tab-rs
- `((cursor . left_ptr)
- (bottom-edge . ,tab-top-dec-pos)) t)
+ (define-frame-class 'tabbar-vertical-bottom-edge
+ `((bottom-edge . ,tab-bottom-edge)) t)
(define (mygroup win)
(if (marked-windows)
(progn
(apply-on-marked-windows (lambda (w) (tab-group-window w win)))
(unmark-all-windows))
- (mark-window win)))
-
- (define-command 'tab-add-to-group mygroup #:spec "%W")
-
- (define (raise-tabs-on-hover-action win)
- (raise-window win))
+ (mark-window win)))
- (define (raise-tabs-on-hover-setter)
- (if (eq tab-raise-on-hover 't)
- (add-hook 'enter-frame-part-hook raise-tabs-on-hover-action)
- (remove-hook 'enter-frame-part-hook raise-tabs-on-hover-action))))
+ (define-command 'tab-add-to-group mygroup #:spec "%W"))
;;(require 'x-cycle)
;;(define-cycle-command-pair
diff --git a/lisp/sawfish/wm/tabs/tabgroup.jl b/lisp/sawfish/wm/tabs/tabgroup.jl
index cf75a28..bdfc95a 100644
--- a/lisp/sawfish/wm/tabs/tabgroup.jl
+++ b/lisp/sawfish/wm/tabs/tabgroup.jl
@@ -30,7 +30,7 @@
tab-rank
tab-group-window-list
tab-group-window)
-
+
(open rep
rep.system
rep.data.records
@@ -44,16 +44,15 @@
sawfish.wm.commands.move-resize
sawfish.wm.stacking
sawfish.wm.util.groups
+ sawfish.wm.commands.groups
sawfish.wm.workspace)
(define-structure-alias tabgroup sawfish.wm.tabs.tabgroup)
(defvar tab-groups nil)
-
(defvar tab-refresh-lock t)
(defvar tab-move-lock t)
-
(define-record-type :tab-group
(tab-build-group p d wl)
tab-group?
@@ -80,26 +79,26 @@
(define (tab-find-window win)
"Return a group containing win"
(let loop ((gr tab-groups))
- (cond
- ((null gr)
- (tab-make-new-group win)
- )
- ((member win (tab-group-window-list (car gr)))
- (car gr))
- (t
- (loop (cdr gr))))))
+ (cond
+ ((null gr)
+ (tab-make-new-group win)
+ )
+ ((member win (tab-group-window-list (car gr)))
+ (car gr))
+ (t
+ (loop (cdr gr))))))
(define (tab-window-group-index win)
"Return the index of the group containing win"
(let loop ((index 0))
- (cond
- ((eq index (length tab-groups))
- (tab-make-new-group win)
- index)
- ((member win (tab-group-window-list (nth index tab-groups)))
- index)
- (t
- (loop (+ index 1))))))
+ (cond
+ ((eq index (length tab-groups))
+ (tab-make-new-group win)
+ index)
+ ((member win (tab-group-window-list (nth index tab-groups)))
+ index)
+ (t
+ (loop (+ index 1))))))
(define (tab-rank elem list)
(if (eq elem (car list))
@@ -116,6 +115,7 @@
(tab-build-group (tab-group-position old) (tab-group-dimensions old) l))
;; releas from sawfish "default" group adopt by tab-group-window
(add-window-to-new-group win)
+ (tab-refresh-group win 'frame)
(window-put win 'fixed-position nil)
(tab-refresh-group (car l) 'frame))))
@@ -133,6 +133,7 @@
(tab-group-dimensions group)
(append (tab-group-window-list group) (list win))))
(tab-move-resize-frame-window-to win (car pos) (cdr pos) (car dim) (cdr dim))
+ (raise-group win)
(rebuild-frame win)))
(define (tab-refresh-group win prop)
@@ -152,8 +153,8 @@
(reframe-window w)) wins))
((eq prop 'reframe-style)
(let ((group-frame-style (window-get win 'frame-style))
- (dim (window-frame-dimensions win))
- (pos (window-position win)))
+ (dim (window-frame-dimensions win))
+ (pos (window-position win)))
(mapcar (lambda (w)
(set-frame-style w group-frame-style)
(tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim))
@@ -168,19 +169,19 @@
(tab-build-group pos dim wins))))
((eq prop 'fixed-position)
(let ((group-frame-fixed-position (window-get win 'fixed-position)))
- (mapcar (lambda (w)
- (window-put w 'fixed-position group-frame-fixed-position)
- (rebuild-frame w)) wins)))
+ (mapcar (lambda (w)
+ (window-put w 'fixed-position group-frame-fixed-position)
+ (rebuild-frame w)) wins)))
((eq prop 'type)
(let ((group-frame-type (window-get win 'type)))
- (mapcar (lambda (w)
- (window-put w 'type group-frame-type)
- (rebuild-frame w)) wins)))
+ (mapcar (lambda (w)
+ (window-put w 'type group-frame-type)
+ (reframe-window w)) wins)))
((eq prop 'depth)
(let ((group-frame-depth (window-get win 'depth)))
- (mapcar (lambda (w)
- (window-put w 'depth group-frame-depth)
- (rebuild-frame w)) wins)))
+ (mapcar (lambda (w)
+ (window-put w 'depth group-frame-depth)
+ (rebuild-frame w)) wins)))
((eq prop 'iconify)
(mapcar (lambda (w)
(iconify-window w)
@@ -213,6 +214,7 @@
(group-frame-type (window-get win 'type))
(group-frame-sticky (window-get win 'sticky))
(group-frame-fixed-position (window-get win 'fixed-position))
+ (group-frame-title-position (window-get win 'title-position))
(group-frame-depth (window-get win 'depth))
;; adopt group for the new tab
;; use sawfish's "default" groups
@@ -221,14 +223,19 @@
(window-put w 'sticky group-frame-sticky)
(window-put w 'depth group-frame-depth)
(window-put w 'fixed-position group-frame-fixed-position)
+ (window-put w 'title-position group-frame-title-position)
(window-put w 'frame-style group-frame-style)
;; ugly hack, don't know why it's needed, but new groups are
;; listed with pos (0,0):
+ (tab-refresh-group w 'reframe)
(tab-refresh-group win 'move)
(add-window-to-group w group-id)
(tab-put-window-in-group w index)
+ ;;
+ ;; call hook to redraw tablength from theme file
+ (call-window-hook 'window-state-change-hook w (list '(title-position)))
(tab-delete-window-from-group w index2)
- (tab-refresh-group win 'move)))
+ (tab-refresh-group win 'move)))
(define (tab-release-window w)
"Release active window from its group"
@@ -243,7 +250,7 @@
(size (length gr))
(r (tab-rank win gr)))
(nth (modulo (+ r n) size) gr)))
-
+
(define (tab-same-group-p w1 w2)
"Predicate : true <=> w1 and w2 are grouped together"
(member w1 (tab-group-window-list (tab-find-window w2))))
@@ -271,7 +278,20 @@
(lambda (w) (eq w win))
(tab-group-window-list (tab-find-window win)))) )
+ (define (raise-tab-group w)
+ (raise-group w))
+
+ (define (tab-group-sticky w)
+ (if (window-get w 'sticky)
+ (make-group-sticky w)
+ (make-group-unsticky w)))
+
(unless batch-mode
+ (add-hook 'focus-in-hook raise-tab-group)
+ (add-hook 'window-state-change-hook
+ (lambda (win args)
+ (if (= '(sticky) args)
+ (tab-group-sticky win))))
(add-hook 'window-state-change-hook
(lambda (win args)
(if (= '(fixed-position) args)
@@ -289,11 +309,15 @@
(if (= '(stacking) args)
(tab-refresh-group win 'depth))))
(add-hook 'after-move-hook (lambda (win) (tab-refresh-group win 'move)))
- (add-hook 'while-moving-hook (lambda (win) (tab-refresh-group win 'move)))
+ (add-hook 'after-resize-hook (lambda (win) (tab-refresh-group win 'resize)))
+ ;; only update tabs by move if opaque move mode (opaque = slow)
+ ;;
+ (when (eq move-outline-mode 'opaque)
+ (add-hook 'while-moving-hook (lambda (win) (tab-refresh-group win 'move)))
+ )
(add-hook 'window-resized-hook (lambda (win) (tab-refresh-group win 'resize)))
(add-hook 'shade-window-hook (lambda (win) (tab-refresh-group win 'shade)))
(add-hook 'unshade-window-hook (lambda (win) (tab-refresh-group win 'unshade)))
(add-hook 'iconify-window-hook (lambda (win) (tab-refresh-group win 'iconify)))
(add-hook 'uniconify-window-hook (lambda (win) (tab-refresh-group win 'uniconify)))
- (add-hook 'destroy-notify-hook tab-delete-window-from-tab-groups)
- (add-hook 'after-framing-hook (lambda (win) (tab-refresh-group win 'reframe)))))
+ (add-hook 'destroy-notify-hook tab-delete-window-from-tab-groups)))
diff --git a/themes/Elberg-tabbed/theme.jl b/themes/Elberg-tabbed/theme.jl
index e9ea3b5..ee211ab 100644
--- a/themes/Elberg-tabbed/theme.jl
+++ b/themes/Elberg-tabbed/theme.jl
@@ -8,440 +8,508 @@
;; Modified to add tabbed windowing support by Scott Scriven.
-(let*
- ;; Update window title pixel length
- ((title-width
- (lambda (w)
- (let
- ((w-width (car (window-dimensions w))))
- (max 0 (min (- w-width 100) (text-width (window-name w)))))))
-
- ;; 6x19 - upper left corner
- (upper-left-images (list (make-image "i-ul.png")
- (make-image "a-ul.png")))
- (upper-left-shaped-images (list (make-image "i-uls.png")
- (make-image "a-uls.png")))
-
- ;; 16x19 - upper left menu button
- (menu-images (list (make-image "i-th.png")
- (make-image "a-th.png")
- (make-image "p-th.png")
- (make-image "c-th.png")))
-
- ;; 11x19 - upper left grey to green border
- (top-lefthollow-images (list (make-image "i-t1.png")
- (make-image "a-t1.png")))
-
- ;; 3x19 - upper green background
- (top-hollow-images (list (make-image "i-t2.png")
- (make-image "a-t2.png")))
-
- ;; 11x19 - upper right green to grey border
- (top-righthollow-images (list (make-image "i-t3.png")
- (make-image "a-t3.png")))
-
- ;; 3x19 - upper grey background
- (top-grey-images (list (make-image "i-t0.png")
- (make-image "a-t0.png")))
-
- ;; 17x16 - iconify icon
- (iconify-images (list (make-image "i-ti.png")
- (make-image "a-ti.png")
- (make-image "p-ti.png")
- (make-image "c-ti.png")))
-
- ;; 17x16 - maximize icon
- (maximize-images (list (make-image "i-tm.png")
- (make-image "a-tm.png")
- (make-image "p-tm.png")
- (make-image "c-tm.png")))
-
- ;; 17x16 - close icon
- (close-images (list (make-image "i-tx.png")
- (make-image "a-tx.png")
- (make-image "p-tx.png")
- (make-image "c-tx.png")))
-
- ;; 18x6 - upper right corner
- (upper-right-images (list (make-image "i-ur.png")
- (make-image "a-ur.png")))
- (upper-right-shaped-images (list (make-image "i-urs.png")
- (make-image "a-urs.png")))
-
-
- ;; 6x18 - left side
- (left-side-images (list (make-image "i-ls.png")
- (make-image "a-ls.png")))
- ;; 6x18 - right side
- (right-side-images (list (make-image "i-rs.png")
- (make-image "a-rs.png")))
-
- ;; 6x6 - lower left corner
- (bottom-left-images (list (make-image "i-ll.png")
- (make-image "a-ll.png")))
- ;; 18x6 - lower ledge
- (bottom-images (list (make-image "i-bot.png")
- (make-image "a-bot.png")))
- ;; 6x6 - lower right corner
- (bottom-right-images (list (make-image "i-lr.png")
- (make-image "a-lr.png")))
-
- ;; 4x4
- (t-upper-left-images (list (make-image "i-tul.png")
- (make-image "a-tul.png")))
- ;; 11x4
- (t-upper-side-images (list (make-image "i-ttop.png")
- (make-image "a-ttop.png")))
- ;; 17x4
- (t-upper-right-images (list (make-image "i-tur.png")
- (make-image "a-tur.png")))
- (t-upper-right-shaped-images (list (make-image "i-turs.png")
- (make-image "a-turs.png")))
-
- ;; 4x17
- (t-left-images (list (make-image "i-tls.png")
- (make-image "a-tls.png")))
-
- ;; 17x16
- (t-close-images (list (make-image "i-ttx.png")
- (make-image "a-ttx.png")
- (make-image "p-ttx.png")
- (make-image "c-ttx.png")))
-
- ;; 17x3
- (t-right-images (list (make-image "i-tt0.png")
- (make-image "a-tt0.png")))
-
- ;; 4x4
- (t-bottom-left-images (list (make-image "i-tll.png")
- (make-image "a-tll.png")))
- ;; 11x4
- (t-bottom-side-images (list (make-image "i-tbot.png")
- (make-image "a-tbot.png")))
- ;; 17x4
- (t-bottom-right-images (list (make-image "i-tlr.png")
- (make-image "a-tlr.png")))
- (t-bottom-right-shaped-images (list (make-image "i-tlrs.png")
- (make-image "a-tlrs.png")))
-
-
- (text-colors '("grey85" "white"))
-
- ;; frame layout
-
- (frame `(((background . ,upper-left-images)
- (left-edge . -6)
- (top-edge . -19)
- (class . top-left-corner))
-
- ;; menu button
- ((background . ,menu-images)
- (top-edge . -19)
- (left-edge . 0)
- (class . menu-button))
-
- ;; top curves
- ;;((background . ,top-lefthollow-images)
- ;; (top-edge . -19)
- ;; ;(left-edge . 16)
- ;; (left-edge . 0)
- ;; (class . title))
-
- ;; top green
- ;;((background . ,top-hollow-images)
- ;; (foreground . ,text-colors)
- ;; (text . ,window-name)
- ;; (x-justify . 4)
- ;; (y-justify . center)
- ;; (top-edge . -19)
- ;; ;(left-edge . 27)
- ;; (left-edge . 11)
- ;; (width . ,(lambda (w) (+ (title-width w) 13)))
- ;; ;(right-edge . 27)
- ;; (class . title))
-
- ;; top curves
- ;;((background . ,top-righthollow-images)
- ;; ;(left-edge . ,(lambda (w) (+ (title-width w) 37)))
- ;; (left-edge . ,(lambda (w) (+ (title-width w) 21)))
- ;; ;(right-edge . 16)
- ;; (top-edge . -19)
- ;; (class . title))
-
- ;; top grey
- ;;((background . ,top-grey-images)
- ;; ;(left-edge . ,(lambda (w) (+ (title-width w) 48)))
- ;; (left-edge . ,(lambda (w) (+ (title-width w) 32)))
- ;; (top-edge . -19)
- ;; ;(right-edge . 48)
- ;; (right-edge . 16)
- ;; (class . title))
-
- ;; left border
- ((background . ,left-side-images)
- (left-edge . -6)
- (top-edge . 0)
- (bottom-edge . 0)
- (class . left-border))
-
- ;; top-right corner
- ((background . ,upper-right-images)
- (right-edge . -6)
- (top-edge . -19)
- (class . top-right-corner))
-
- ;; right border
- ((background . ,right-side-images)
- (right-edge . -6)
- (top-edge . 0)
- (bottom-edge . 0)
- (class . right-border))
-
- ;; bottom border
- ((background . ,bottom-images)
- (left-edge . 0)
- (right-edge . 0)
- (bottom-edge . -6)
- (class . bottom-border))
-
- ;; bottom-left corner
- ((background . ,bottom-left-images)
- (left-edge . -6)
- (bottom-edge . -6)
- (class . bottom-left-corner))
-
- ;; bottom-right corner
- ((background . ,bottom-right-images)
- (right-edge . -6)
- (bottom-edge . -6)
- (class . bottom-right-corner))
-
- ;; iconify button
- ;((background . ,iconify-images)
- ; (right-edge . 32)
- ; (top-edge . -19)
- ; (class . iconify-button))
-
- ;; maximize button
- ;((background . ,maximize-images)
- ; (right-edge . 16)
- ; (top-edge . -19)
- ; (class . maximize-button))
-
- ;; delete button
- ((background . ,close-images)
- (right-edge . 0)
- (top-edge . -19)
- (class . close-button))
-
- ;; tab left curve
- ((background . ,top-lefthollow-images)
- (top-edge . -19)
- (class . tab-l))
-
- ;; tab
- (
- (background . ,top-hollow-images)
- (foreground . ,text-colors)
- (top-edge . -19)
- ;(left-edge . 0)
- (height . 19)
- (text . ,window-name)
- ;(x-justify . 4)
- ;(y-justify . center)
- (class . tab))
-
- ;; tab right curve
- ((background . ,top-righthollow-images)
- (top-edge . -19)
- (class . tab-r))
-
-
- ))
-
- (shaped-frame `(((background . ,upper-left-shaped-images)
- (left-edge . -6)
- (top-edge . -19)
- (height . 19)
- (class . top-left-corner))
-
- ;; menu button
- ((background . ,menu-images)
- (top-edge . -19)
- (left-edge . 0)
- (class . menu-button))
-
- ;; top curves
- ;((background . ,top-lefthollow-images)
- ;(top-edge . -19)
- ;(left-edge . 16)
- ;(class . title))
-
- ;; Title text area
- ;((background . ,top-hollow-images)
- ;(foreground . ,text-colors)
- ;(text . ,window-name)
- ;(x-justify . 4)
- ;(y-justify . center)
- ;(top-edge . -19)
- ;(left-edge . 27)
- ;(width . ,(lambda (w) (+ (title-width w) 13)))
- ;(class . title))
-
- ;; top curves
- ;((background . ,top-righthollow-images)
- ;(left-edge . ,(lambda (w) (+ (title-width w) 37)))
- ;(top-edge . -19)
- ;(class . title))
-
- ;; top grey
- ;((background . ,top-grey-images)
- ;(left-edge . ,(lambda (w) (+ (title-width w) 48)))
- ;(top-edge . -19)
- ;(right-edge . 48)
- ;(class . title))
-
- ;; top-right corner
- ((background . ,upper-right-shaped-images)
- (right-edge . -6)
- (top-edge . -19)
- (height . 19)
- (class . top-right-corner))
-
- ;; iconify button
- ;((background . ,iconify-images)
- ;(right-edge . 32)
- ;(top-edge . -19)
- ;(class . iconify-button))
-
- ;; maximize button
- ;((background . ,maximize-images)
- ;(right-edge . 16)
- ;(top-edge . -19)
- ;(class . maximize-button))
-
- ;; delete button
- ((background . ,close-images)
- (right-edge . 0)
- (top-edge . -19)
- (class . close-button))
-
- ;; tab left curve
- ((background . ,top-lefthollow-images)
- (top-edge . -19)
- (class . tab-l))
-
- ;; tab
- (
- (background . ,top-hollow-images)
- (foreground . ,text-colors)
- (top-edge . -19)
- ;(left-edge . 0)
- (height . 19)
- (text . ,window-name)
- ;(x-justify . 4)
- ;(y-justify . center)
- (class . tab))
-
- ;; tab right curve
- ((background . ,top-righthollow-images)
- (top-edge . -19)
- (class . tab-r))
-
- ))
-
-
- (transient-frame `(((background . ,t-upper-left-images)
- (left-edge . -4)
- (top-edge . -4)
- (class . top-left-corner))
-
- ;;top-right corner
- ((background . ,t-upper-right-images)
- (right-edge . -17)
- (top-edge . -4)
- (class . top-right-corner))
-
- ;;title border
- ((background . ,t-upper-side-images)
- (left-edge . -1)
- (right-edge . -1)
- (top-edge . -4)
- (class . top-border))
-
- ;; left border
- ((background . ,t-left-images)
- (left-edge . -4)
- (top-edge . -1)
- (bottom-edge . -1)
- (class . left-border))
-
- ;; right border
- ((background . ,t-right-images)
- (right-edge . -17)
- (top-edge . -1)
- (bottom-edge . -1)
- (class . title))
-
- ;; bottom border
- ((background . ,t-bottom-side-images)
- (left-edge . -1)
- (right-edge . -1)
- (bottom-edge . -4)
- (class . bottom-border))
-
- ;; bottom-left corner
- ((background . ,t-bottom-left-images)
- (left-edge . -4)
- (bottom-edge . -4)
- (class . bottom-left-corner))
-
- ;; bottom-right corner
- ((background . ,t-bottom-right-images)
- (right-edge . -17)
- (bottom-edge . -4)
- (class . bottom-right-corner))
-
- ;; delete button
- ((background . ,t-close-images)
- (right-edge . -17)
- (top-edge . 1)
- (class . close-button))
-
- ))
-
- (shaped-transient-frame `(((background . ,t-upper-right-shaped-images)
- (right-edge . -17)
- (top-edge . -4)
- (class . top-right-corner))
-
- ;; right border
- ((background . ,t-right-images)
- (right-edge . -17)
- (top-edge . -1)
- (bottom-edge . -1)
- (class . title))
-
- ;; bottom-right corner
- ((background . ,t-bottom-right-shaped-images)
- (right-edge . -17)
- (bottom-edge . -4)
- (class . bottom-right-corner))
-
- ;; delete button
- ((background . ,t-close-images)
- (right-edge . -17)
- (top-edge . 1)
- (class . close-button)))))
-
- (add-frame-style 'Elberg-tabbed
- (lambda (w type)
- (case type
- ((default) frame)
- ((transient) transient-frame)
- ((shaped) shaped-frame)
- ((shaped-transient) shaped-transient-frame))))
-
- (call-after-property-changed
- '(WM_NAME _NET_WM_NAME) (lambda (w prop state)
- (reframe-window w))))
+
+;;(define title-width
+;; (lambda (w)
+;; (let
+;; ((w-width (car (window-dimensions w))))
+;; (max 0 (min (- w-width 100) (text-width (window-name w)))))))
+
+;; 6x19 - upper left corner
+(define upper-left-images (list (make-image "i-ul.png")
+ (make-image "a-ul.png")))
+(define upper-left-shaped-images (list (make-image "i-uls.png")
+ (make-image "a-uls.png")))
+
+;; 16x19 - upper left menu button
+(define menu-images
+ (list (make-image "i-th.png")
+ (make-image "a-th.png")
+ (make-image "p-th.png")
+ (make-image "c-th.png")))
+
+;; 11x19 - upper left grey to green border
+(define top-lefthollow-images
+ (list (make-image "i-t1.png")
+ (make-image "a-t1.png")))
+
+;; 3x19 - upper green background
+(define top-hollow-images
+ (list (make-image "i-t2.png")
+ (make-image "a-t2.png")))
+
+;; 11x19 - upper right green to grey border
+(define top-righthollow-images
+ (list (make-image "i-t3.png")
+ (make-image "a-t3.png")))
+
+;; 3x19 - upper grey background
+(define top-grey-images
+ (list (make-image "i-t0.png")
+ (make-image "a-t0.png")))
+
+;; 17x16 - iconify icon
+(define iconify-images
+ (list (make-image "i-ti.png")
+ (make-image "a-ti.png")
+ (make-image "p-ti.png")
+ (make-image "c-ti.png")))
+
+;; 17x16 - maximize icon
+(define maximize-images
+ (list (make-image "i-tm.png")
+ (make-image "a-tm.png")
+ (make-image "p-tm.png")
+ (make-image "c-tm.png")))
+
+;; 17x16 - close icon
+(define close-images
+ (list (make-image "i-tx.png")
+ (make-image "a-tx.png")
+ (make-image "p-tx.png")
+ (make-image "c-tx.png")))
+
+;; 18x6 - upper right corner
+(define upper-right-images
+ (list (make-image "i-ur.png")
+ (make-image "a-ur.png")))
+
+(define upper-right-shaped-images
+ (list (make-image "i-urs.png")
+ (make-image "a-urs.png")))
+
+;; 6x18 - left side
+(define left-side-images
+ (list (make-image "i-ls.png")
+ (make-image "a-ls.png")))
+
+;; 6x18 - right side
+(define right-side-images
+ (list (make-image "i-rs.png")
+ (make-image "a-rs.png")))
+
+;; 6x6 - lower left corner
+(define bottom-left-images
+ (list (make-image "i-ll.png")
+ (make-image "a-ll.png")))
+
+;; 18x6 - lower ledge
+(define bottom-images
+ (list (make-image "i-bot.png")
+ (make-image "a-bot.png")))
+
+;; 6x6 - lower right corner
+(define bottom-right-images
+ (list (make-image "i-lr.png")
+ (make-image "a-lr.png")))
+
+;; 4x4
+(define t-upper-left-images
+ (list (make-image "i-tul.png")
+ (make-image "a-tul.png")))
+
+;; 11x4
+(define t-upper-side-images
+ (list (make-image "i-ttop.png")
+ (make-image "a-ttop.png")))
+
+;; 17x4
+(define t-upper-right-images
+ (list (make-image "i-tur.png")
+ (make-image "a-tur.png")))
+
+(define t-upper-right-shaped-images
+ (list (make-image "i-turs.png")
+ (make-image "a-turs.png")))
+
+;; 4x17
+(define t-left-images
+ (list (make-image "i-tls.png")
+ (make-image "a-tls.png")))
+
+;; 17x16
+(define t-close-images
+ (list (make-image "i-ttx.png")
+ (make-image "a-ttx.png")
+ (make-image "p-ttx.png")
+ (make-image "c-ttx.png")))
+
+;; 17x3
+(define t-right-images
+ (list (make-image "i-tt0.png")
+ (make-image "a-tt0.png")))
+
+;; 4x4
+(define t-bottom-left-images
+ (list (make-image "i-tll.png")
+ (make-image "a-tll.png")))
+
+;; 11x4
+(define t-bottom-side-images
+ (list (make-image "i-tbot.png")
+ (make-image "a-tbot.png")))
+
+;; 17x4
+(define t-bottom-right-images
+ (list (make-image "i-tlr.png")
+ (make-image "a-tlr.png")))
+
+(define t-bottom-right-shaped-images
+ (list (make-image "i-tlrs.png")
+ (make-image "a-tlrs.png")))
+
+(define text-colors (list "grey50" "white"))
+
+
+;; frame layout
+
+(define frame
+ `(((background . ,upper-left-images)
+ (left-edge . -6)
+ (top-edge . -19)
+ (class . top-left-corner))
+
+ ;; menu button
+ ((background . ,menu-images)
+ (top-edge . -19)
+ (left-edge . 0)
+ (class . menu-button))
+
+ ;; top curves
+ ;;((background . ,top-lefthollow-images)
+ ;; (top-edge . -19)
+ ;; ;(left-edge . 16)
+ ;; (left-edge . 0)
+ ;; (class . title))
+
+ ;; top green
+ ;;((background . ,top-hollow-images)
+ ;; (foreground . ,text-colors)
+ ;; (text . ,window-name)
+ ;; (x-justify . 4)
+ ;; (y-justify . center)
+ ;; (top-edge . -19)
+ ;; ;(left-edge . 27)
+ ;; (left-edge . 11)
+ ;; (width . ,(lambda (w) (+ (title-width w) 13)))
+ ;; ;(right-edge . 27)
+ ;; (class . title))
+
+ ;; top curves
+ ;;((background . ,top-righthollow-images)
+ ;; ;(left-edge . ,(lambda (w) (+ (title-width w) 37)))
+ ;; (left-edge . ,(lambda (w) (+ (title-width w) 21)))
+ ;; ;(right-edge . 16)
+ ;; (top-edge . -19)
+ ;; (class . title))
+
+ ;; top grey
+ ;;((background . ,top-grey-images)
+ ;; ;(left-edge . ,(lambda (w) (+ (title-width w) 48)))
+ ;; (left-edge . ,(lambda (w) (+ (title-width w) 32)))
+ ;; (top-edge . -19)
+ ;; ;(right-edge . 48)
+ ;; (right-edge . 16)
+ ;; (class . title))
+
+ ;; left border
+ ((background . ,left-side-images)
+ (left-edge . -6)
+ (top-edge . 0)
+ (bottom-edge . 0)
+ (class . left-border))
+
+ ;; top-right corner
+ ((background . ,upper-right-images)
+ (right-edge . -6)
+ (top-edge . -19)
+ (class . top-right-corner))
+
+ ;; right border
+ ((background . ,right-side-images)
+ (right-edge . -6)
+ (top-edge . 0)
+ (bottom-edge . 0)
+ (class . right-border))
+
+ ;; bottom border
+ ((background . ,bottom-images)
+ (left-edge . 0)
+ (right-edge . 0)
+ (bottom-edge . -6)
+ (class . bottom-border))
+
+ ;; bottom-left corner
+ ((background . ,bottom-left-images)
+ (left-edge . -6)
+ (bottom-edge . -6)
+ (class . bottom-left-corner))
+
+ ;; bottom-right corner
+ ((background . ,bottom-right-images)
+ (right-edge . -6)
+ (bottom-edge . -6)
+ (class . bottom-right-corner))
+
+ ;; iconify button
+ ;;((background . ,iconify-images)
+ ;; (right-edge . 32)
+ ;; (top-edge . -19)
+ ;; (class . iconify-button))
+
+ ;; maximize button
+ ;;((background . ,maximize-images)
+ ;; (right-edge . 16)
+ ;; (top-edge . -19)
+ ;; (class . maximize-button))
+
+ ;; delete button
+ ((background . ,close-images)
+ (right-edge . 0)
+ (top-edge . -19)
+ (class . close-button))
+
+ ;; tab left curve
+ ((background . ,top-lefthollow-images)
+ (top-edge . -19)
+ (class . tabbar-horizontal-left-edge))
+
+ ;; tab
+ ((background . ,top-hollow-images)
+ (foreground . ,text-colors)
+ (top-edge . -19)
+ ;;(left-edge . 0)
+ (height . 19)
+ (text . ,window-name)
+ ;;(x-justify . 4)
+ ;;(y-justify . center)
+ (class . tabbar-horizontal))
+
+ ;; tab right curve
+ ((background . ,top-righthollow-images)
+ (top-edge . -19)
+ (class . tabbar-horizontal-right-edge))))
+
+(define shaped-frame
+ `(((background . ,upper-left-shaped-images)
+ (left-edge . -6)
+ (top-edge . -19)
+ (height . 19)
+ (class . top-left-corner))
+
+ ;; menu button
+ ((background . ,menu-images)
+ (top-edge . -19)
+ (left-edge . 0)
+ (class . menu-button))
+
+ ;; top curves
+ ;;((background . ,top-lefthollow-images)
+ ;;(top-edge . -19)
+ ;;(left-edge . 16)
+ ;;(class . title))
+
+ ;; Title text area
+ ;;((background . ,top-hollow-images)
+ ;;(foreground . ,text-colors)
+ ;;(text . ,window-name)
+ ;;(x-justify . 4)
+ ;;(y-justify . center)
+ ;;(top-edge . -19)
+ ;;(left-edge . 27)
+ ;;(width . ,(lambda (w) (+ (title-width w) 13)))
+ ;;(class . title))
+
+ ;; top curves
+ ;;((background . ,top-righthollow-images)
+ ;;(left-edge . ,(lambda (w) (+ (title-width w) 37)))
+ ;;(top-edge . -19)
+ ;;(class . title))
+
+ ;; top grey
+ ;;((background . ,top-grey-images)
+ ;;(left-edge . ,(lambda (w) (+ (title-width w) 48)))
+ ;;(top-edge . -19)
+ ;;(right-edge . 48)
+ ;;(class . title))
+
+ ;; top-right corner
+ ((background . ,upper-right-shaped-images)
+ (right-edge . -6)
+ (top-edge . -19)
+ (height . 19)
+ (class . top-right-corner))
+
+ ;; iconify button
+ ;;((background . ,iconify-images)
+ ;;(right-edge . 32)
+ ;;(top-edge . -19)
+ ;;(class . iconify-button))
+
+ ;; maximize button
+ ;;((background . ,maximize-images)
+ ;;(right-edge . 16)
+ ;;(top-edge . -19)
+ ;;(class . maximize-button))
+
+ ;; delete button
+ ((background . ,close-images)
+ (right-edge . 0)
+ (top-edge . -19)
+ (class . close-button))
+
+ ;; tab left curve
+ ((background . ,top-lefthollow-images)
+ (top-edge . -19)
+ (class . tabbar-horizontal-left-edge))
+
+ ;; tab
+ ((background . ,top-hollow-images)
+ (foreground . ,text-colors)
+ (top-edge . -19)
+ ;;(left-edge . 0)
+ (height . 19)
+ (text . ,window-name)
+ ;;(x-justify . 4)
+ ;;(y-justify . center)
+ (class . tabbar-horizontal))
+
+ ;; tab right curve
+ ((background . ,top-righthollow-images)
+ (top-edge . -19)
+ (class . tabbar-horizontal-right-edge))))
+
+
+(define transient-frame
+ `(((background . ,t-upper-left-images)
+ (left-edge . -4)
+ (top-edge . -4)
+ (class . top-left-corner))
+
+ ;;top-right corner
+ ((background . ,t-upper-right-images)
+ (right-edge . -17)
+ (top-edge . -4)
+ (class . top-right-corner))
+
+ ;;title border
+ ((background . ,t-upper-side-images)
+ (left-edge . -1)
+ (right-edge . -1)
+ (top-edge . -4)
+ (class . top-border))
+
+ ;; left border
+ ((background . ,t-left-images)
+ (left-edge . -4)
+ (top-edge . -1)
+ (bottom-edge . -1)
+ (class . left-border))
+
+ ;; right border
+ ((background . ,t-right-images)
+ (right-edge . -17)
+ (top-edge . -1)
+ (bottom-edge . -1)
+ (class . title))
+
+ ;; bottom border
+ ((background . ,t-bottom-side-images)
+ (left-edge . -1)
+ (right-edge . -1)
+ (bottom-edge . -4)
+ (class . bottom-border))
+
+ ;; bottom-left corner
+ ((background . ,t-bottom-left-images)
+ (left-edge . -4)
+ (bottom-edge . -4)
+ (class . bottom-left-corner))
+
+ ;; bottom-right corner
+ ((background . ,t-bottom-right-images)
+ (right-edge . -17)
+ (bottom-edge . -4)
+ (class . bottom-right-corner))
+
+ ;; delete button
+ ((background . ,t-close-images)
+ (right-edge . -17)
+ (top-edge . 1)
+ (class . close-button))))
+
+
+(define shaped-transient-frame
+ `(((background . ,t-upper-right-shaped-images)
+ (right-edge . -17)
+ (top-edge . -4)
+ (class . top-right-corner))
+
+ ;; right border
+ ((background . ,t-right-images)
+ (right-edge . -17)
+ (top-edge . -1)
+ (bottom-edge . -1)
+ (class . title))
+
+ ;; bottom-right corner
+ ((background . ,t-bottom-right-shaped-images)
+ (right-edge . -17)
+ (bottom-edge . -4)
+ (class . bottom-right-corner))
+
+ ;; delete button
+ ((background . ,t-close-images)
+ (right-edge . -17)
+ (top-edge . 1)
+ (class . close-button))))
+
+(define create-frames
+ (lambda ()
+ (let ((Elberg-left-d-w 11)
+ (Elberg-right-d-w 11)
+ (Elberg-left-m 16)
+ (Elberg-rigth-m 16)
+ (Elberg-left-m-t 0)
+ (Elberg-right-m-t 0))
+ (require 'sawfish.wm.tabs.tab)
+ (set-tab-adjustments #:theme-left-dec-width Elberg-left-d-w #:theme-right-dec-width Elberg-right-d-w #:theme-left-margin
+ Elberg-left-m #:theme-right-margin Elberg-rigth-m #:theme-left-margin-transient Elberg-left-m-t
+ #:theme-right-margin-transient Elberg-right-m-t))))
+
+(create-frames)
+
+(add-frame-style 'Elberg-tabbed
+ (lambda (w type)
+ (case type
+ ((default) frame)
+ ((transient) transient-frame)
+ ((shaped) shaped-frame)
+ ((shaped-transient) shaped-transient-frame))))
+
+(define (create-frames-only w)
+ (lambda ()
+ (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed)
+ (create-frames))))
+
+(define (reframe-one w)
+ (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed)
+ (create-frames)
+ (reframe-window w)))
+
+(define (reframe-group w)
+ (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed)
+ (map-window-group
+ (lambda (x)
+ (reframe-one x)) w)))
+
+;; create only frames when focus a window don't draw
+;;
+(add-hook 'focus-in-hook create-frames-only)
+(add-hook 'add-window-hook create-frames-only)
+
+(call-after-property-changed '(WM_HINTS WM_NAME _NET_WM_NAME _NET_WM_STATE _NET_WM_DESKTOP) reframe-one)
+
+;; tabgroup.jl call
+;;
+(call-after-state-changed '(title-position) reframe-group)
diff --git a/themes/get-S-tabbed/theme.jl b/themes/get-S-tabbed/theme.jl
index 5d4f8db..9291bfb 100644
--- a/themes/get-S-tabbed/theme.jl
+++ b/themes/get-S-tabbed/theme.jl
@@ -2,319 +2,352 @@
;; Based off of my arctic Enlightenment theme....
-
-(let*
- (
- ;;(font (get-font "-*-lucida-medium-r-normal-*-*-100-*-*-p-*-iso8859-1"))
- ;;(font (get-font "Sans 9"))
- (font default-font)
- (font-colors (list "grey50" "white"))
-
- (title-images
- (list (make-image "title-bar-inactive.png")
- (make-image "title-bar-active.png")))
-
- (title-left-images
- (list (set-image-border
- (make-image "title-left-inactive.png") 10 10 0 0)
- (set-image-border
- (make-image "title-left-active.png") 10 10 0 0)))
-
- (title-left-f-images
- (list (set-image-border
- (make-image "title-left-inactive-f.png") 10 10 3 1)
- (set-image-border
- (make-image "title-left-active-f.png") 10 10 3 1)))
-
- (title-left-l-images
- (list (make-image "title-left-inactive-l.png")
- (make-image "title-left-active-l.png")))
-
- (title-left-m-images
- (list (set-image-border
- (make-image "title-left-inactive-m.png") 10 10 0 0)
- (set-image-border
- (make-image "title-left-active-m.png") 10 10 0 0)))
-
- (title-left-r-images
- (list (make-image "title-left-inactive-r.png")
- (make-image "title-left-active-r.png")))
-
- (iconify-images
- (list (make-image "iconify-normal.png")
- nil nil
- (make-image "iconify-clicked.png")))
-
- (maximize-images
- (list (make-image "maximize-normal.png")
- nil nil
- (make-image "maximize-clicked.png")))
-
- (menu-images
- (list (make-image "menu-normal.png")
- nil nil
- (make-image "menu-clicked.png")))
-
- (close-images
- (list (make-image "close-normal.png")
- nil nil
- (make-image "close-clicked.png")))
-
- (title-right
- (set-image-border(make-image "title-right.png")10 10 10 10))
- (title-right-l
- (set-image-border(make-image "title-right-l.png") 3 0 10 10))
- (title-right-r
- (set-image-border(make-image "title-right-r.png") 0 3 10 10))
- (border-top (make-image "border_top.png"))
- (border-bottom (make-image "border_bottom.png"))
- (border-right (make-image "border_right.png"))
- (border-left (make-image "border_left.png"))
-
- (corner-tl (make-image "corner_top_left.png"))
- (corner-tr (make-image "corner_top_right.png"))
- (corner-tl-2 (make-image "corner_top_left_2.png"))
- (corner-tr-2 (make-image "corner_top_right_2.png"))
- (corner-bl (make-image "corner_bottom_left.png"))
- (corner-br (make-image "corner_bottom_right.png"))
- (corner-bl-2 (make-image "corner_bottom_left_2.png"))
- (corner-br-2 (make-image "corner_bottom_right_2.png"))
-
- (shaped-frame `(((background . ,title-left-images)
- (foreground . ,font-colors)
- (font . ,font)
- (text . ,window-name)
- (x-justify . center)
- (y-justify . center)
- (top-edge . -16)
- (left-edge . 15)
- (right-edge . 40)
- (class . title))))
-
- (shaped-transient-frame `(((background . ,title-images)
- (foreground . ,font-colors)
- (font . ,font)
- (text . ,window-name)
- (x-justify . center)
- (y-justify . center)
- (top-edge . -12)
- (left-edge . 0)
- (right-edge . 0)
- (class . title))
-
- ((background . ,menu-images)
- (top-edge . -12)
- (left-edge . 1)
- (class . menu-button))
-
- ((background . ,iconify-images)
- (top-edge . -12)
- (right-edge . 26)
- (class . iconify-button))
-
- ((background . ,maximize-images)
- (top-edge . -12)
- (right-edge . 13)
- (class . maximize-button))
-
- ((background . ,close-images)
- (top-edge . -12)
- (right-edge . 1)
- (class . close-button))
-
- ((background . ,border-left)
- (top-edge . -12)
- ;;(bottom-edge . 0)
- (left-edge . -2)
- (class . left-border))
-
- ((background . ,border-right)
- (top-edge . -12)
- ;;(bottom-edge . 0)
- (right-edge . -2)
- (class . right-border))
-
- ((background . ,border-top)
- (top-edge . -14)
- (right-edge . 0)
- (left-edge . 0)
- (class . top-border))
-
- ((background . ,border-bottom)
- (top-edge . 0)
- (right-edge . 0)
- (left-edge . 0)
- (class . bottom-border))
-
- ((background . ,corner-tl)
- (top-edge . -14)
- (left-edge . -2)
- (class . top-left-corner))
-
- ((background . ,corner-tr)
- (top-edge . -14)
- (right-edge . -2)
- (class . top-right-corner))
-
- ((background . ,corner-bl-2)
- (top-edge . 0)
- (left-edge . -2)
- (class . bottom-left-corner))
-
- ((background . ,corner-br-2)
- (top-edge . 0)
- (right-edge . -2)
- (class . bottom-right-corner))))
-
- (transient-frame `(((background . ,border-left)
- (top-edge . -2)
- (bottom-edge . 0)
- (left-edge . -2)
- (class . left-border))
-
- ((background . ,border-right)
- (top-edge . -2)
- (bottom-edge . 0)
- (right-edge . -2)
- (class . right-border))
-
- ((background . ,border-top)
- (top-edge . -2)
- (right-edge . 0)
- (left-edge . 0)
- (class . title))
-
- ((background . ,border-bottom)
- (bottom-edge . -2)
- (right-edge . 0)
- (left-edge . 0)
- (class . bottom-border))
-
- ((background . ,corner-tl-2)
- (top-edge . -2)
- (left-edge . -2)
- (class . top-left-corner))
-
- ((background . ,corner-tr-2)
- (top-edge . -2)
- (right-edge . -2)
- (class . top-right-corner))
-
- ((background . ,corner-bl)
- (bottom-edge . -2)
- (left-edge . -2)
- (class . bottom-left-corner))
-
- ((background . ,corner-br)
- (bottom-edge . -2)
- (right-edge . -2)
- (class . bottom-right-corner))))
-
- (frame `(
- ;; TODO: re-add this part
- ;;((background . ,title-right)
- ;; (top-edge . -14)
- ;; (left-edge . -3)
- ;; (right-edge . -3)
- ;; (class . title))
-
- ;; left part of title background
- ((background . ,title-right-l)
- (top-edge . -14)
- (left-edge . -3)
- (width . 18)
- (class . title))
-
- ;; right part of title background
- ((background . ,title-right-r)
- (top-edge . -14)
- (width . 42)
- (right-edge . -3)
- (class . title))
-
- ;; tab
- ;;((background . ,title-left-f-images)
- ((background . ,title-left-m-images)
- (foreground . ,font-colors)
- (font . ,font)
- (text . ,window-name)
- (x-justify . center)
- (y-justify . center)
- (top-edge . -16)
- ;;(left-edge . 15)
- ;;(right-edge . 40)
- (class . tab))
-
- ;; tab
- ((background . ,title-left-l-images)
- (top-edge . -16)
- (class . tab-l))
-
- ;; tab
- ((background . ,title-left-r-images)
- (top-edge . -16)
- (class . tab-r))
-
- ((background . ,menu-images)
- (top-edge . -12)
- (left-edge . 1)
- (class . menu-button))
-
- ((background . ,iconify-images)
- (top-edge . -12)
- (right-edge . 26)
- (class . iconify-button))
-
- ((background . ,maximize-images)
- (top-edge . -12)
- (right-edge . 13)
- (class . maximize-button))
-
- ((background . ,close-images)
- (top-edge . -12)
- (right-edge . 1)
- (class . close-button))
-
- ((background . ,border-left)
- (top-edge . 0)
- (bottom-edge . 0)
- (left-edge . -2)
- (class . left-border))
-
- ((background . ,border-right)
- (top-edge . 0)
- (bottom-edge . 0)
- (right-edge . -2)
- (class . right-border))
-
- ((background . ,border-bottom)
- (bottom-edge . 0)
- (right-edge . 0)
- (left-edge . 0)
- (class . bottom-border))
-
- ((background . ,corner-bl)
- (bottom-edge . 0)
- (left-edge . -2)
- (class . bottom-left-corner))
-
- ((background . ,corner-br)
- (bottom-edge . 0)
- (right-edge . -2)
- (class . bottom-right-corner)))))
-
- (add-frame-style 'get-S-tabbed
- (lambda (w type)
- (case type
- ((default) frame)
- ((transient) transient-frame)
- ((shaped) shaped-frame)
- ((shaped-transient) shaped-transient-frame))))
-
- ;; TODO: figure out how to store this info in this file correctly
- ;;(custom-set-typed-variable'tab-left-dec-width '5 'number)
- ;;(custom-set-typed-variable'tab-right-dec-width '5 'number)
- ;;(custom-set-typed-variable'tab-left-margin '14 'number)
- ;;(custom-set-typed-variable'tab-right-margin '38 'number)
-
- )
+(define font default-font)
+(define font-colors (list "grey50" "white"))
+
+
+(define title-images
+ (list (make-image "title-bar-inactive.png")
+ (make-image "title-bar-active.png")))
+
+(define title-left-images
+ (list (set-image-border
+ (make-image "title-left-inactive.png") 10 10 0 0)
+ (set-image-border
+ (make-image "title-left-active.png") 10 10 0 0)))
+
+(define title-left-f-images
+ (list (set-image-border
+ (make-image "title-left-inactive-f.png") 10 10 3 1)
+ (set-image-border
+ (make-image "title-left-active-f.png") 10 10 3 1)))
+
+(define title-left-l-images
+ (list (make-image "title-left-inactive-l.png")
+ (make-image "title-left-active-l.png")))
+
+(define title-left-m-images
+ (list (set-image-border
+ (make-image "title-left-inactive-m.png") 10 10 0 0)
+ (set-image-border
+ (make-image "title-left-active-m.png") 10 10 0 0)))
+
+(define title-left-r-images
+ (list (make-image "title-left-inactive-r.png")
+ (make-image "title-left-active-r.png")))
+
+(define iconify-images
+ (list (make-image "iconify-normal.png")
+ nil nil
+ (make-image "iconify-clicked.png")))
+
+(define maximize-images
+ (list (make-image "maximize-normal.png")
+ nil nil
+ (make-image "maximize-clicked.png")))
+
+(define menu-images
+ (list (make-image "menu-normal.png")
+ nil nil
+ (make-image "menu-clicked.png")))
+
+(define close-images
+ (list (make-image "close-normal.png")
+ nil nil
+ (make-image "close-clicked.png")))
+
+(define title-right
+ (set-image-border(make-image "title-right.png")10 10 10 10))
+(define title-right-l
+ (set-image-border(make-image "title-right-l.png") 3 0 10 10))
+(define title-right-r
+ (set-image-border(make-image "title-right-r.png") 0 3 10 10))
+(define border-top (make-image "border_top.png"))
+(define border-bottom (make-image "border_bottom.png"))
+(define border-right (make-image "border_right.png"))
+(define border-left (make-image "border_left.png"))
+
+(define corner-tl (make-image "corner_top_left.png"))
+(define corner-tr (make-image "corner_top_right.png"))
+(define corner-tl-2 (make-image "corner_top_left_2.png"))
+(define corner-tr-2 (make-image "corner_top_right_2.png"))
+(define corner-bl (make-image "corner_bottom_left.png"))
+(define corner-br (make-image "corner_bottom_right.png"))
+(define corner-bl-2 (make-image "corner_bottom_left_2.png"))
+(define corner-br-2 (make-image "corner_bottom_right_2.png"))
+
+(define shaped-frame
+ `(((background . ,title-left-images)
+ (foreground . ,font-colors)
+ (font . ,font)
+ (text . ,window-name)
+ (x-justify . center)
+ (y-justify . center)
+ (top-edge . -16)
+ (left-edge . 15)
+ (right-edge . 40)
+ (class . title))))
+
+(define shaped-transient-frame
+ `(((background . ,title-images)
+ (foreground . ,font-colors)
+ (font . ,font)
+ (text . ,window-name)
+ (x-justify . center)
+ (y-justify . center)
+ (top-edge . -12)
+ (left-edge . 0)
+ (right-edge . 0)
+ (class . title))
+
+ ((background . ,menu-images)
+ (top-edge . -12)
+ (left-edge . 1)
+ (class . menu-button))
+
+ ((background . ,iconify-images)
+ (top-edge . -12)
+ (right-edge . 26)
+ (class . iconify-button))
+
+ ((background . ,maximize-images)
+ (top-edge . -12)
+ (right-edge . 13)
+ (class . maximize-button))
+
+ ((background . ,close-images)
+ (top-edge . -12)
+ (right-edge . 1)
+ (class . close-button))
+
+ ((background . ,border-left)
+ (top-edge . -12)
+ ;;(bottom-edge . 0)
+ (left-edge . -2)
+ (class . left-border))
+
+ ((background . ,border-right)
+ (top-edge . -12)
+ ;;(bottom-edge . 0)
+ (right-edge . -2)
+ (class . right-border))
+
+ ((background . ,border-top)
+ (top-edge . -14)
+ (right-edge . 0)
+ (left-edge . 0)
+ (class . top-border))
+
+ ((background . ,border-bottom)
+ (top-edge . 0)
+ (right-edge . 0)
+ (left-edge . 0)
+ (class . bottom-border))
+
+ ((background . ,corner-tl)
+ (top-edge . -14)
+ (left-edge . -2)
+ (class . top-left-corner))
+
+ ((background . ,corner-tr)
+ (top-edge . -14)
+ (right-edge . -2)
+ (class . top-right-corner))
+
+ ((background . ,corner-bl-2)
+ (top-edge . 0)
+ (left-edge . -2)
+ (class . bottom-left-corner))
+
+ ((background . ,corner-br-2)
+ (top-edge . 0)
+ (right-edge . -2)
+ (class . bottom-right-corner))))
+
+(define transient-frame
+ `(((background . ,border-left)
+ (top-edge . -2)
+ (bottom-edge . 0)
+ (left-edge . -2)
+ (class . left-border))
+
+ ((background . ,border-right)
+ (top-edge . -2)
+ (bottom-edge . 0)
+ (right-edge . -2)
+ (class . right-border))
+
+ ((background . ,border-top)
+ (top-edge . -2)
+ (right-edge . 0)
+ (left-edge . 0)
+ (class . title))
+
+ ((background . ,border-bottom)
+ (bottom-edge . -2)
+ (right-edge . 0)
+ (left-edge . 0)
+ (class . bottom-border))
+
+ ((background . ,corner-tl-2)
+ (top-edge . -2)
+ (left-edge . -2)
+ (class . top-left-corner))
+
+ ((background . ,corner-tr-2)
+ (top-edge . -2)
+ (right-edge . -2)
+ (class . top-right-corner))
+
+ ((background . ,corner-bl)
+ (bottom-edge . -2)
+ (left-edge . -2)
+ (class . bottom-left-corner))
+
+ ((background . ,corner-br)
+ (bottom-edge . -2)
+ (right-edge . -2)
+ (class . bottom-right-corner))))
+
+(define frame
+ `(
+ ;; TODO: re-add this part
+ ;;((background . ,title-right)
+ ;; (top-edge . -14)
+ ;; (left-edge . -3)
+ ;; (right-edge . -3)
+ ;; (class . title))
+
+ ;; left part of title background
+ ((background . ,title-right-l)
+ (top-edge . -14)
+ (left-edge . -3)
+ (width . 18)
+ (class . title))
+
+ ;; right part of title background
+ ((background . ,title-right-r)
+ (top-edge . -14)
+ (width . 42)
+ (right-edge . -3)
+ (class . title))
+
+ ;; tab
+ ;;((background . ,title-left-f-images)
+ ((background . ,title-left-m-images)
+ (foreground . ,font-colors)
+ (font . ,font)
+ (text . ,window-name)
+ (x-justify . center)
+ (y-justify . center)
+ (top-edge . -16)
+ ;;(left-edge . 15)
+ ;;(right-edge . 40)
+ (class . tabbar-horizontal))
+
+ ;; tab
+ ((background . ,title-left-l-images)
+ (top-edge . -16)
+ (class . tabbar-horizontal-left-edge))
+
+ ;; tab
+ ((background . ,title-left-r-images)
+ (top-edge . -16)
+ (class . tabbar-horizontal-right-edge))
+
+ ((background . ,menu-images)
+ (top-edge . -12)
+ (left-edge . 1)
+ (class . menu-button))
+
+ ((background . ,iconify-images)
+ (top-edge . -12)
+ (right-edge . 26)
+ (class . iconify-button))
+
+ ((background . ,maximize-images)
+ (top-edge . -12)
+ (right-edge . 13)
+ (class . maximize-button))
+
+ ((background . ,close-images)
+ (top-edge . -12)
+ (right-edge . 1)
+ (class . close-button))
+
+ ((background . ,border-left)
+ (top-edge . 0)
+ (bottom-edge . 0)
+ (left-edge . -2)
+ (class . left-border))
+
+ ((background . ,border-right)
+ (top-edge . 0)
+ (bottom-edge . 0)
+ (right-edge . -2)
+ (class . right-border))
+
+ ((background . ,border-bottom)
+ (bottom-edge . 0)
+ (right-edge . 0)
+ (left-edge . 0)
+ (class . bottom-border))
+
+ ((background . ,corner-bl)
+ (bottom-edge . 0)
+ (left-edge . -2)
+ (class . bottom-left-corner))
+
+ ((background . ,corner-br)
+ (bottom-edge . 0)
+ (right-edge . -2)
+ (class . bottom-right-corner))))
+
+(define create-frames
+ (lambda ()
+ (let ((left-d-w 5)
+ (right-d-w 5)
+ (left-m 14)
+ (rigth-m 38)
+ (left-m-t 0)
+ (right-m-t 0))
+ (require 'sawfish.wm.tabs.tab)
+ (set-tab-adjustments #:theme-left-dec-width left-d-w #:theme-right-dec-width right-d-w #:theme-left-margin left-m #:theme-right-margin rigth-m
+ #:theme-left-margin-transient left-m-t #:theme-right-margin-transient right-m-t))))
+
+(create-frames)
+
+(add-frame-style 'get-S-tabbed
+ (lambda (w type)
+ (case type
+ ((default) frame)
+ ((transient) transient-frame)
+ ((shaped) shaped-frame)
+ ((shaped-transient) shaped-transient-frame))))
+
+(define (create-frames-only w)
+ (lambda ()
+ (when (eq (window-get w 'current-frame-style) 'get-S-tabbed)
+ (create-frames))))
+
+(define (reframe-one w)
+ (when (eq (window-get w 'current-frame-style) 'get-S-tabbed)
+ (create-frames)
+ (reframe-window w)))
+
+(define (reframe-group w)
+ (when (eq (window-get w 'current-frame-style) 'get-S-tabbed)
+ (map-window-group
+ (lambda (x)
+ (reframe-one x)) w)))
+
+;; create only frames when focus a window don't draw
+;;
+(add-hook 'focus-in-hook create-frames-only)
+(add-hook 'add-window-hook create-frames-only)
+
+(call-after-property-changed '(WM_HINTS WM_NAME _NET_WM_NAME _NET_WM_STATE _NET_WM_DESKTOP) reframe-one)
+
+;; tabgroup.jl call
+;;
+(call-after-state-changed '(title-position) reframe-group)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]