Browse Source

Clock: Independent face for clock overlay display.

William Henney writes:

     If a heading has tags, then that heading's time summary
     overlay (shown by C-c C-x C-d) is displayed using the
     org-tag face. This looks a bit strange. Is it intended? It
     is especially noticeable in my case, since I have my tags
     shown in a smaller font.

This is cause by the fact that we use the `secondary-selection' face
here which only highlights but inherits the rest from what is below.
The idea was that these clock times should have the same color as the
headline they belong to, but this idea is defeated when a line has tags
with a very different face.

This commit introduces a separate face for this purpose, so that users
can customize it.
Carsten Dominik 16 years ago
parent
commit
7d05ba72c8
3 changed files with 24 additions and 1 deletions
  1. 7 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-clock.el
  3. 16 0
      lisp/org-faces.el

+ 7 - 0
lisp/ChangeLog

@@ -1,3 +1,10 @@
+2009-01-22  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-clock.el (org-clock-put-overlay): Use new face instead of
+	`secondary-selection'.
+
+	* org-faces.el (org-clock-overlay): New face.
+
 2009-01-21  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-exp.el (org-get-current-options): Include the option for

+ 1 - 1
lisp/org-clock.el

@@ -605,7 +605,7 @@ will be easy to remove."
 		     (org-add-props (format fmt
 					    (make-string l ?*) h m
 					    (make-string (- 16 l) ?\ ))
-			 '(face secondary-selection))
+			 (list 'face 'org-clock-overlay))
 		     ""))
     (if (not (featurep 'xemacs))
 	(org-overlay-put ov 'display tx)

+ 16 - 0
lisp/org-faces.el

@@ -396,6 +396,22 @@ changes."
   :group 'org-faces
   :version "22.1")
 
+(defface org-clock-overlay ;; copied from secondary-selection
+  (org-compatible-face nil
+    '((((class color) (min-colors 88) (background light))
+       :background "yellow1")
+      (((class color) (min-colors 88) (background dark))
+       :background "SkyBlue4")
+      (((class color) (min-colors 16) (background light))
+       :background "yellow")
+      (((class color) (min-colors 16) (background dark))
+       :background "SkyBlue4")
+      (((class color) (min-colors 8))
+       :background "cyan" :foreground "black")
+      (t :inverse-video t))
+    "Basic face for displaying the secondary selection."
+    :group 'org-faces))
+
 (defface org-agenda-structure ;; originally copied from font-lock-function-name-face
   (org-compatible-face nil
     '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))