Re: [merge request] Tab rework



Hi,

On Fri, 11 Feb 2011 17:52:41 +0900 (JST)
wrote Teika Kazura <teika lavabit com>:

>Keybinding is changed a bit, but I believe it's easy to understand.

Maybe we add this in Styletab dialog?

-- 
Regards,
Fuchur

GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
diff -urNad sawfish-git-9999.orgi/themes/StyleTab/theme.jl sawfish-git-9999/themes/StyleTab/theme.jl
--- sawfish-git-9999.orgi/themes/StyleTab/theme.jl	2011-02-12 03:16:06.000000000 +0100
+++ sawfish-git-9999/themes/StyleTab/theme.jl	2011-02-12 03:22:52.000000000 +0100
@@ -52,7 +52,7 @@
 (defgroup StyleTab:right-bottom-buttons-group "Right Titlebar Bottom Buttons"
   :group (appearance StyleTab:group StyleTab:buttons-group StyleTab:right-buttons-group))
 
-(defcustom styletab:style 'Dark "Frame and button style."
+(defcustom styletab:style 'Dark "Frame and button style."
   :group (appearance StyleTab:group StyleTab:settings-group)
   :options (Reduce Dark DarkColor Silver SilverColor Smoothly)
   :type symbol)
@@ -82,6 +82,11 @@
   :depends styletab:custom-button-width
   :range (-4 . 4))
 
+(defcustom styletab:title-font (get-font "-*-helvetica-bold-r-normal-*-9-*-*-*-*-*-*")
+  "Tabbar font."
+  :group (appearance StyleTab:group StyleTab:settings-group)
+  :type font)
+
 (defcustom styletab:custom-colors nil "Customize title text colors. (Don't use styles defaults.)"
   :group (appearance StyleTab:group StyleTab:settings-group)
   :type boolean)
@@ -110,6 +115,34 @@
   :depends styletab:custom-colors
   :type color)
 
+(defcustom styletab:customize-horiz-icon-keymap
+  nil
+  "Customize horizontal tabbar icon keymap. Select to edit."
+  :group (appearance StyleTab:group StyleTab:settings-group)
+  :type boolean)
+
+(defcustom styletab:customize-horiz-keymap
+  (bind-keys (make-keymap) "Button3-Off" 'horiz-button3 "Button2-Off" 'horiz-button2 "Button1-Off" 'horiz-button1)
+  nil
+  :group (appearance StyleTab:group StyleTab:settings-group)
+  :widget-flags (expand-horizontally)
+  :depends styletab:customize-horiz-icon-keymap
+  :type keymap)
+
+(defcustom styletab:customize-vert-icon-keymap
+  nil
+  "Customize vertical tabbar icon keymap. Select to edit."
+  :group (appearance StyleTab:group StyleTab:settings-group)
+  :type boolean)
+
+(defcustom styletab:customize-vert-keymap
+  (bind-keys (make-keymap) "Button3-Off" 'vert-button3 "Button2-Off" 'vert-button2 "Button1-Off" 'vert-button1)
+  nil
+  :group (appearance StyleTab:group StyleTab:settings-group)
+  :widget-flags (expand-horizontally)
+  :depends styletab:customize-vert-icon-keymap
+  :type keymap)
+
 (mapc
  (lambda (arg)
    (let ((type-list ;; ":type" in defcustom
@@ -349,17 +382,10 @@
 (define-command-gaol 'vert-button2 vert-button2)
 (define-command-gaol 'vert-button3 vert-button3)
 
-(def-frame-class tabbar-horizontal-left-edge ()
-  (bind-keys tabbar-horizontal-left-edge-keymap
-	     "Button1-Off" 'horiz-button1
-	     "Button2-Off" 'horiz-button2
-	     "Button3-Off" 'horiz-button3))
-
-(def-frame-class tabbar-vertical-top-edge ()
-  (bind-keys tabbar-vertical-top-edge-keymap
-	     "Button1-Off" 'vert-button1
-	     "Button2-Off" 'vert-button2
-	     "Button3-Off" 'vert-button3))
+(defvar tabbar-horizontal-left-edge-keymap  styletab:customize-horiz-keymap)
+(def-frame-class 'tabbar-horizontal-left-edge '((keymap . tabbar-horizontal-left-edge-keymap)))
+(defvar tabbar-vertical-top-edge-keymap  styletab:customize-vert-keymap)
+(def-frame-class 'tabbar-vertical-left-edge '((keymap . tabbar-vertical-left-edge-keymap)))
 
 (defvar prev-button-keymap
   (bind-keys (make-keymap)
@@ -399,18 +425,16 @@
          (setq typ 'default)
          (setq dim-x (- dim-x (* styletab:borders-dimension 2)))         
          (setq dim-y (- dim-y styletab:borders-dimension))
-         (when
-             (not (or (eq current-title 'top)
-                      (eq current-title 'bottom)))
+         (when (not (or (eq current-title 'top)
+                        (eq current-title 'bottom)))
            (setq dim-x (+ dim-x styletab:borders-dimension))
            (setq dim-y (- dim-y styletab:borders-dimension))))
        (when (eq type 'shaped-transient)
          (setq typ 'transient)
          (setq dim-x (- dim-x (* styletab:borders-dimension 2)))
          (setq dim-y (- dim-y styletab:borders-dimension))
-         (when
-             (not (or (eq current-title 'top)
-                      (eq current-title 'bottom)))
+         (when (not (or (eq current-title 'top)
+                        (eq current-title 'bottom)))
            (setq dim-x (+ dim-x styletab:borders-dimension))
            (setq dim-y (- dim-y styletab:borders-dimension))))
        (set-window-type w typ)
@@ -480,18 +504,16 @@
          (setq typ 'shaped)
          (setq dim-x (+ dim-x (* styletab:borders-dimension 2)))
          (setq dim-y (+ dim-y styletab:borders-dimension))
-         (when
-             (not (or (eq current-title 'top)
-                      (eq current-title 'bottom)))
+         (when (not (or (eq current-title 'top)
+                        (eq current-title 'bottom)))
            (setq dim-x (- dim-x styletab:borders-dimension))
            (setq dim-y (+ dim-y styletab:borders-dimension))))
        (when (eq type 'transient)
          (setq typ 'shaped-transient)
          (setq dim-x (+ dim-x (* styletab:borders-dimension 2)))
          (setq dim-y (+ dim-y styletab:borders-dimension))
-         (when
-             (not (or (eq current-title 'top)
-                      (eq current-title 'bottom)))
+         (when (not (or (eq current-title 'top)
+                        (eq current-title 'bottom)))
            (setq dim-x (- dim-x styletab:borders-dimension))
            (setq dim-y (+ dim-y styletab:borders-dimension))))
        (set-window-type w typ)
@@ -1090,6 +1112,7 @@
      (y-justify . center)
      (background . ,(tab-images "top"))
      (foreground . ,title-colors-images)
+     (font . ,(lambda () (list styletab:title-font)))
      (top-edge . ,title-edge-s)
      (height . ,title-height-s)
      (text . ,window-name))
@@ -1120,6 +1143,7 @@
      (y-justify . center)
      (background . ,(tab-images "bottom"))
      (foreground . ,title-colors-images)
+     (font . ,(lambda () (list styletab:title-font)))
      (bottom-edge . ,title-edge)
      (height . ,title-height-s)
      (text . ,window-name))
@@ -2052,7 +2076,7 @@
 
 ;; also reset all cache 
 ;;
-(define (clear-cache-reframe-style)
+(define (clear-cache-reload-frame-style)
   (setq icon-cache (make-weak-table eq-hash eq))
   (setq frame-cache (make-weak-table eq-hash eq))
   (reload-frame-style theme-name))
@@ -2062,13 +2086,13 @@
 ;;
 (call-after-state-changed '(title-position) create-frames-only)
 
-
+(custom-set-property 'styletab:title-font ':after-set reframe-all)
 (custom-set-property 'styletab:custom-colors ':after-set reframe-all)
 (custom-set-property 'styletab:focused-color ':after-set reframe-all)
 (custom-set-property 'styletab:highlighted-color ':after-set reframe-all)
 (custom-set-property 'styletab:inactive-color ':after-set reframe-all)
 (custom-set-property 'styletab:inactive-highlighted-color ':after-set reframe-all)
-(custom-set-property 'styletab:style ':after-set clear-cache-reframe-style)
+(custom-set-property 'styletab:style ':after-set clear-cache-reload-frame-style)
 (custom-set-property 'styletab:title-dimension ':after-set clear-cache-reframe)
 (custom-set-property 'styletab:custom-button-width ':after-set clear-cache-reframe)
 (custom-set-property 'styletab:button-width ':after-set clear-cache-reframe)

Attachment: Bildschirmfoto-Sawfish-Einstellungen.png
Description: PNG image

Attachment: signature.asc
Description: PGP signature



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