Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature/header faces #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ Note that setting list-size for the agenda list is intentionally ignored; all ag

It is possible to customize Dashboard's appearance using the following faces:

- ~dashboard-banner-logo-title-face~ ::
- ~dashboard-banner-logo-title~ ::
Highlights the banner title.
- ~dashboard-text-banner-face~ ::
- ~dashboard-text-banner~ ::
Highlights text banners.
- ~dashboard-heading-face~ ::
- ~dashboard-heading~ ::
Highlights widget headings.
- ~widget-button~ ::
Highlights widget items.
Expand Down
21 changes: 14 additions & 7 deletions dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,28 @@ Set to nil for unbounded.")
;;
;; Faces
;;
(defface dashboard-text-banner-face
(defface dashboard-text-banner
'((t :inherit default))
"Face used for text banners."
:group 'dashboard)

(defface dashboard-banner-logo-title-face
(defface dashboard-banner-logo-title
'((t :inherit default))
"Face used for the banner title."
:group 'dashboard)

(defface dashboard-heading-face
'((t :inherit default))
(defface dashboard-heading
'((t (:inherit font-lock-function-name-face)))
"Face used for widget headings."
:group 'dashboard)

(define-obsolete-face-alias
'dashboard-text-banner-face 'dashboard-text-banner "1.2.6")
(define-obsolete-face-alias
'dashboard-banner-logo-title-face 'dashboard-banner-logo-title "1.2.6")
(define-obsolete-face-alias
'dashboard-heading-face 'dashboard-heading "1.2.6")

;;
;; Generic widget helpers
;;
Expand Down Expand Up @@ -162,7 +169,7 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer."

(defun dashboard-insert-heading (heading &optional shortcut)
"Insert a widget HEADING in dashboard buffer, adding SHORTCUT if provided."
(insert (propertize heading 'face 'dashboard-heading-face))
(insert (propertize heading 'face 'dashboard-heading))
(if shortcut (insert (format " (%s)" shortcut))))

;;
Expand All @@ -186,7 +193,7 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer."
(insert (make-string margin ?\ ))
(forward-line 1))))
(buffer-string))))
(put-text-property 0 (length ascii-banner) 'face 'dashboard-text-banner-face ascii-banner)
(put-text-property 0 (length ascii-banner) 'face 'dashboard-text-banner ascii-banner)
(insert ascii-banner)))

(defun dashboard-insert-image-banner (banner)
Expand All @@ -212,7 +219,7 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer."
(when title
(insert (make-string (max 0 (floor (/ (- dashboard-banner-length
(+ (length title) 1)) 2))) ?\ ))
(insert (format "%s\n\n" (propertize title 'face 'dashboard-banner-logo-title-face)))))))
(insert (format "%s\n\n" (propertize title 'face 'dashboard-banner-logo-title)))))))

(defun dashboard-get-banner-path (index)
"Return the full path to banner with index INDEX."
Expand Down