Re: Some stuff to discuss about



OK, here is a patch for frames.jl, it fixes those compiler warnings and
the startup warning.  The compiler warnings were caused by a misplaced
parens :) and moving the 'update-frame-font-color function to be above
the customizing functions fixes the startup warning.  This lasts through
sessions now by adding your suggested code to the initialization section
of frames.jl

diff --git a/lisp/sawfish/wm/frames.jl b/lisp/sawfish/wm/frames.jl
index 1dc6cd4..c7c0673 100644
--- a/lisp/sawfish/wm/frames.jl
+++ b/lisp/sawfish/wm/frames.jl
@@ -161,6 +161,37 @@ that overrides settings set elsewhere.")
       (splash . unframed))
     "Frame type fallbacks.")
 
+  ;; Re-Coloring Options for Themes
+
+  (define (update-frame-font-color)
+    (if use-custom-font-color
+	(mapc (lambda (fc)
+		(set-frame-part-value fc 'foreground (list frame-font-inactive-color frame-font-focus-color) 't)) (list 'title 'tab))
+      (mapc (lambda (fc)
+	      (rplacd (assoc 'foreground (assoc fc override-frame-part-classes)) nil)
+	      (rplaca (assoc 'foreground (assoc fc override-frame-part-classes)) nil)) (list 'title 'tab)))
+    (mapc (lambda (x) (rebuild-frame x)) (managed-windows)))
+
+  (defcustom frame-font-focus-color "black"
+    "Font color for active frames"
+    :type color
+    :group appearance
+    :depends use-custom-font-color
+    :after-set (lambda () (update-frame-font-color)))
+
+  (defcustom frame-font-inactive-color "black"
+    "Font color for inactive frames"
+    :type color
+    :group appearance
+    :depends use-custom-font-color
+    :after-set (lambda () (update-frame-font-color)))
+
+  (defcustom use-custom-font-color '()
+    "Use custom font colors for frames"
+    :type boolean
+    :group appearance
+    :after-set (lambda () (update-frame-font-color)))
+
   (defvar theme-update-interval 60
     "Number of seconds between checking if theme files have been modified.")
 
@@ -655,4 +686,9 @@ deciding which frame type to ask a theme to generate.")
 
   (sm-add-saved-properties 'ignored 'frame-style)
   (sm-add-restored-properties 'type)
-  (add-swapped-properties 'frame-active-color 'frame-inactive-color))
+  (add-swapped-properties 'frame-active-color 'frame-inactive-color)
+
+  (if (and use-custom-font-color
+	   (or (variable-customized-p 'frame-font-focus-color)
+	       (variable-customized-p 'frame-font-inactive-color)))
+      (update-frame-font-color)))
-- 
Matthew Love


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