image-dired: Add faces for header line

* lisp/image/image-dired.el (image-dired-thumb-header-file-name)
(image-dired-thumb-header-directory-name)
(-image-dired-thumb-header-file-size)
(image-dired-thumb-header-image-count): New faces.
(image-dired-format-properties-string): Use above new faces.
(image-dired-thumb-mark, image-dired-thumb-flagged): Move
definition further down.
This commit is contained in:
Stefan Kangas 2022-09-24 20:08:25 +02:00
parent 573f31db96
commit 0e6c15bbaf
2 changed files with 68 additions and 24 deletions

View file

@ -2128,6 +2128,15 @@ old format, add this to your Init file:
(setopt image-dired-display-properties-format "%b: %f (%t): %c")
---
*** New faces for the header line of the thumbnail buffer.
These faces correspond to different parts of the header line, as
specified in 'image-dired-display-properties-format':
- 'image-dired-thumb-header-file-name'
- 'image-dired-thumb-header-directory-name'
- 'image-dired-thumb-header-file-size'
- 'image-dired-thumb-header-image-count'
---
*** PDF support.
Image-Dired now displays thumbnails for PDF files. Type 'RET' on a

View file

@ -259,22 +259,6 @@ deletion."
:type 'boolean
:version "28.1")
(defface image-dired-thumb-mark
'((((class color) (min-colors 16)) :background "DarkOrange")
(((class color)) :foreground "yellow"))
"Face for marked images in thumbnail buffer."
:version "29.1")
(defface image-dired-thumb-flagged
'((((class color) (min-colors 88) (background light)) :background "Red3")
(((class color) (min-colors 88) (background dark)) :background "Pink")
(((class color) (min-colors 16) (background light)) :background "Red3")
(((class color) (min-colors 16) (background dark)) :background "Pink")
(((class color) (min-colors 8)) :background "red")
(t :inverse-video t))
"Face for images flagged for deletion in thumbnail buffer."
:version "29.1")
(defcustom image-dired-line-up-method 'dynamic
"Default method for line-up of thumbnails in thumbnail buffer.
Used by `image-dired-display-thumbs' and other functions that needs
@ -362,6 +346,52 @@ This affects the following commands:
:type 'boolean
:version "29.1")
;;; Faces
;;;; Header line
(defface image-dired-thumb-header-file-name
'((default :weight bold))
"Face for the file name in the header line of the thumbnail buffer."
:version "29.1")
(defface image-dired-thumb-header-directory-name
'((default :inherit header-line))
"Face for the directory name in the header line of the thumbnail buffer."
:version "29.1")
(defface -image-dired-thumb-header-file-size
'((((class color) (min-colors 88)) :foreground "cadet blue")
(((class color) (min-colors 16)) :foreground "black")
(default :inherit header-line))
"Face for the file size in the header line of the thumbnail buffer."
:version "29.1")
(defface image-dired-thumb-header-image-count
'((default :inherit header-line))
"Face for the image count in the header line of the thumbnail buffer."
:version "29.1")
;;;; Thumbnail buffer
(defface image-dired-thumb-mark
'((((class color) (min-colors 16)) :background "DarkOrange")
(((class color)) :foreground "yellow")
(default :inherit header-line))
"Face for marked images in thumbnail buffer."
:version "29.1")
(defface image-dired-thumb-flagged
'((((class color) (min-colors 88) (background light)) :background "Red3")
(((class color) (min-colors 88) (background dark)) :background "Pink")
(((class color) (min-colors 16) (background light)) :background "Red3")
(((class color) (min-colors 16) (background dark)) :background "Pink")
(((class color) (min-colors 8)) :background "red")
(t :inverse-video t))
"Face for images flagged for deletion in thumbnail buffer."
:version "29.1")
;;; Util functions
@ -731,14 +761,19 @@ comment."
(format-spec
image-dired-display-properties-format
`((?b . ,(or buf ""))
(?d . ,(file-name-nondirectory
(directory-file-name
(file-name-directory file))))
(?f . ,(file-name-nondirectory file))
(?n . ,image-count)
(?s . ,(file-size-human-readable
(file-attribute-size
(file-attributes file))))
(?d . ,(propertize
(file-name-nondirectory
(directory-file-name
(file-name-directory file)))
'face 'image-dired-thumb-header-directory-name))
(?f . ,(propertize (file-name-nondirectory file)
'face 'image-dired-thumb-header-file-name))
(?n . ,(propertize image-count
'face 'image-dired-thumb-header-image-count))
(?s . ,(propertize (file-size-human-readable
(file-attribute-size
(file-attributes file)))
'face 'image-dired-thumb-header-file-size))
(?t . ,(or props ""))
(?c . ,(or comment "")))))