stumpwm-devel
[Top][All Lists]
Advanced

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

[STUMP] [PATCH] Change show-frame-indicator to use screen-border-color.


From: John Li
Subject: [STUMP] [PATCH] Change show-frame-indicator to use screen-border-color.
Date: Sat, 2 Aug 2008 03:36:56 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

Also added a bit of docs on the frame indicator.
---

Right after sending that last patch, I thought of this instead. Maybe
it's better.

But... maybe we should have a stumpwm theme format? :) This would:
1. Let people twiddle more things (different text colors, different
   font sizes, etc.). I personally want to be able to set a huge font for
   the fselect frame numbers.
2. Let us throw away all the little set-fg-color, set-border-width,
   etc. functions as well as the *normal-border-width*,
   *mode-line-background-color*, etc. variables.
3. Let people share themes easily.

I'm thinking something like:
(mode-line-font "-lispm-..."
 mode-line-foreground-color "Pink"
 ...
 window-focus-color "Pink")

But to cut down on duplication:
(defvar *fg-color* "Pink")
...

(mode-line-font "-lispm-..."
 mode-line-foreground-color *fg-color*
 ...
 window-focus-color *fg-color*)


Perhaps this sucks - I'll cook up a patch and see how it
looks. Meanwhile, let me know what you think.

 message-window.lisp |   18 ++++++++++--------
 screen.lisp         |    4 ++--
 stumpwm.texi.in     |   17 ++++++++++++++++-
 3 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/message-window.lisp b/message-window.lisp
index 38497aa..3d31155 100644
--- a/message-window.lisp
+++ b/message-window.lisp
@@ -153,12 +153,13 @@ (defun show-frame-indicator (group &optional force)
               (and (or (> (length (tile-group-frame-tree group)) 1)
                        (not (atom (first (tile-group-frame-tree group)))))
                    (not *suppress-frame-indicator*)))
-      (let ((frame (tile-group-current-frame group))
-            (w (screen-frame-window (current-screen)))
-            (string (if (stringp *frame-indicator-text*)
-                        *frame-indicator-text*
-                        (prin1-to-string *frame-indicator-text*)))
-            (font (screen-font (current-screen))))
+      (let* ((frame (tile-group-current-frame group))
+             (screen (current-screen))
+             (w (screen-frame-window screen))
+             (string (if (stringp *frame-indicator-text*)
+                         *frame-indicator-text*
+                         (prin1-to-string *frame-indicator-text*)))
+             (font (screen-font screen)))
         ;; If it's already mapped it'll appear briefly in the wrong
         ;; place, so unmap it first.
         (xlib:unmap-window w)
@@ -167,9 +168,10 @@ (defun show-frame-indicator (group &optional force)
                                        (truncate (- (frame-width frame) 
(xlib:text-width font string)) 2))
                 (xlib:drawable-y w) (+ (frame-display-y group frame)
                                        (truncate (- (frame-height frame) 
(font-height font)) 2))
-                (xlib:window-priority w) :above))
+                (xlib:window-priority w) :above
+                (xlib:window-border w) (screen-border-color screen)))
         (xlib:map-window w)
-        (echo-in-window w font (screen-fg-color (current-screen)) 
(screen-bg-color (current-screen)) string)
+        (echo-in-window w font (screen-fg-color screen) (screen-bg-color 
screen) string)
         (reset-frame-indicator-timer)))))
 
 (defun echo-in-window (win font fg bg string)
diff --git a/screen.lisp b/screen.lisp
index 4be2598..ba4d34e 100644
--- a/screen.lisp
+++ b/screen.lisp
@@ -266,8 +266,8 @@ (defun set-bg-color (color)
   (set-any-color screen-bg-color color))
 
 (defun set-border-color (color)
-  "Set the border color for the message bar and input
-bar. @var{color} can be any color recognized by X."
+  "Set the border color for the message bar, input bar, and frame
+indicator. @var{color} can be any color recognized by X."
   (set-any-color screen-border-color color))
 
 (defun set-win-bg-color (color)
diff --git a/stumpwm.texi.in b/stumpwm.texi.in
index 4b622b4..38d23f6 100644
--- a/stumpwm.texi.in
+++ b/stumpwm.texi.in
@@ -835,6 +835,7 @@ window pool, where windows and frames are not so tightly 
connected.
 @menu
 * Interactively Resizing Frames::  
 * Frame Dumping::               
+* Frame Indicator::
 @end menu
 
 @node Interactively Resizing Frames, Frame Dumping, Frames, Frames
@@ -880,7 +881,7 @@ Select the highlighted option.
 
 ### *resize-increment*
 
address@hidden Frame Dumping,  , Interactively Resizing Frames, Frames
address@hidden Frame Dumping, Frame Indicator, Interactively Resizing Frames, 
Frames
 @section Frame Dumping
 The configuration of frames and groups can be saved and restored using
 the following commands.
@@ -894,6 +895,20 @@ the following commands.
 !!! restore-from-file
 !!! place-existing-windows
 
address@hidden Frame Indicator,  , Frame Dumping, Frames
address@hidden Frame Indicator
+The frame indicator is displayed when the user switches frames. It's
+handy for easily seeing what the newly focused frame is, especially if
+your window border is thin or the border color doesn't strongly
+contrast the window color.
+
+!!! curframe
+!!! set-border-color
+
+### *timeout-frame-indicator-wait*
+### *suppress-frame-indicator*
+### *frame-indicator-text*
+
 @node Mode-line, Groups, Frames, Top
 @chapter The Mode Line
 The mode line is a bar that runs across either the top or bottom of
-- 
1.5.6.3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]