Commit ba625cce authored by Philippe Brochard's avatar Philippe Brochard
Browse files

Use different colors for windows and frames in fastswitch-mode. Limit drawing...

Use different colors for windows and frames in fastswitch-mode. Limit drawing area when there is a lot of children.
parent 223b8f75
......@@ -45,7 +45,10 @@
(labels ((display-match-child ()
(let ((pos 1))
(dolist (ex-child *fastswitch-match-child*)
(xlib:with-gcontext (*fastswitch-gc* :foreground (get-color *fastswitch-foreground-letter-second*))
(xlib:with-gcontext (*fastswitch-gc*
:foreground (get-color (if (frame-p (expose-child-child ex-child))
*fastswitch-foreground-letter-second-frame*
*fastswitch-foreground-letter-second*)))
(xlib:draw-glyphs *pixmap-buffer* *fastswitch-gc*
(* (xlib:max-char-width *fastswitch-font*) pos)
(+ (* 2 (xlib:font-ascent *fastswitch-font*)) (xlib:font-descent *fastswitch-font*) 1)
......@@ -61,7 +64,9 @@
(* (xlib:max-char-width *fastswitch-font*) pos)
(+ (* 2 (xlib:font-ascent *fastswitch-font*)) (xlib:font-descent *fastswitch-font*) 1)
(child-fullname (expose-child-child ex-child)))
(incf pos (1+ (length (child-fullname (expose-child-child ex-child))))))))))
(incf pos (1+ (length (child-fullname (expose-child-child ex-child))))))
(when (> (* pos (xlib:max-char-width *fastswitch-font*)) (xlib:drawable-width *fastswitch-window*))
(return))))))
(clear-pixmap-buffer *fastswitch-window* *fastswitch-gc*)
(xlib:with-gcontext (*fastswitch-gc* :foreground (get-color *fastswitch-foreground-letter*)
:background (get-color *fastswitch-background*))
......
......@@ -349,6 +349,8 @@ on the root window in the main mode with the mouse")
'Fastswitch-mode "Fastswitch string window foreground color for letters")
(defconfig *fastswitch-foreground-letter-second* "magenta"
'Fastswitch-mode "Fastswitch string window foreground color for letters")
(defconfig *fastswitch-foreground-letter-second-frame* "yellow"
'Fastswitch-mode "Fastswitch string window foreground color for letters for frames")
(defconfig *fastswitch-foreground-childname* "grey70"
'Fastswitch-mode "Fastswitch string window foreground color for childname")
(defconfig *fastswitch-border* "grey20"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment