diff options
author | Damien Elmes <emms@repose.cx> | 2006-07-04 14:01:00 +0000 |
---|---|---|
committer | Damien Elmes <emms@repose.cx> | 2006-07-04 14:01:00 +0000 |
commit | 6bc9791da7daebbc89bb6f2ad2da83c14a5f8ff8 (patch) | |
tree | 2f78a5874cbf18c7fbf5e43ed14d877c90b93920 | |
parent | c02d6cf3b3cadeea7e2063f96696cd2edb70468e (diff) |
browser: make faces dependent on type, not level
also renamed the faces - you'll need to customize them again if you've
customized them before.
darcs-hash:20060704140109-4e3e3-3e575fd46005c48cacc715f4f4fa5ec35249a2a9.gz
-rw-r--r-- | emms-browser.el | 76 |
1 files changed, 29 insertions, 47 deletions
diff --git a/emms-browser.el b/emms-browser.el index a340ec1..c6c98d0 100644 --- a/emms-browser.el +++ b/emms-browser.el @@ -1231,49 +1231,27 @@ included." "")) "%n")) -(defface emms-browser-tracks-sub-face-1 - '((((class color) (background dark)) - (:foreground "#aaaaff")) - (((class color) (background light)) - (:foreground "Blue")) - (((type tty) (class mono)) - (:inverse-video t)) - (t (:background "Blue"))) - "Face for the tracks in a playlist buffer." - :group 'emms-browser-mode) - -(defface emms-browser-tracks-sub-face-2 - '((((class color) (background dark)) - (:foreground "#7777ff")) - (((class color) (background light)) - (:foreground "Blue")) - (((type tty) (class mono)) - (:inverse-video t)) - (t (:background "Blue"))) - "Face for the tracks in a playlist buffer." - :group 'emms-browser-mode) - -(defface emms-browser-tracks-sub-face-3 - '((((class color) (background dark)) - (:foreground "#4444ff")) - (((class color) (background light)) - (:foreground "Blue")) - (((type tty) (class mono)) - (:inverse-video t)) - (t (:background "Blue"))) - "Face for the tracks in a playlist buffer." - :group 'emms-browser-mode) - -(defface emms-browser-tracks-sub-face-4 - '((((class color) (background dark)) - (:foreground "#3333ff")) - (((class color) (background light)) - (:foreground "Blue")) - (((type tty) (class mono)) - (:inverse-video t)) - (t (:background "Blue"))) - "Face for the tracks in a playlist buffer." - :group 'emms-browser-mode) +(defmacro emms-browser-make-face (name dark-col light-col height) + (let ((face-name (intern (concat "emms-browser-" name "-face")))) + `(defface ,face-name + '((((class color) (background dark)) + (:foreground ,dark-col + :height ,height)) + (((class color) (background light)) + (:foreground ,light-col + :height ,height)) + (((type tty) (class mono)) + (:inverse-video t)) + (t (:background ,dark-col))) + ,(concat "Face for " + name + " in a browser/playlist buffer.") + :group 'emms-browser-mode))) + +(emms-browser-make-face "year/genre" "#aaaaff" "#444477" 1.5) +(emms-browser-make-face "artist" "#aaaaff" "#444477" 1.3) +(emms-browser-make-face "album" "#aaaaff" "#444477" 1.1) +(emms-browser-make-face "track" "#aaaaff" "#444477" 1.0) (defun emms-browser-bdata-first-track (bdata) "Return the first track from a given bdata. @@ -1364,11 +1342,15 @@ If > album level, most of the track data will not make sense." (defun emms-browser-get-face (bdata) "Return a suitable face for BDATA." - (let ((lvl (emms-browser-bdata-level bdata)) - (type (emms-browser-bdata-type bdata))) + (let* ((type (emms-browser-bdata-type bdata)) + (name (cond + ((or (eq type 'info-year) + (eq type 'info-genre)) "year/genre") + ((eq type 'info-artist) "artist") + ((eq type 'info-album) "album") + ((eq type 'info-title) "track")))) (intern - (concat "emms-browser-tracks-sub-face-" - (int-to-string lvl))))) + (concat "emms-browser-" name "-face")))) ;; based on gnus code (defun emms-browser-format-spec (format specification) |