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

Skip to content

Inherit height on agenda entries from dashboard-items-face. #435

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
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
12 changes: 8 additions & 4 deletions dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -1179,12 +1179,16 @@ Also,it set text properties that latter are used to sort entries and perform dif
(todo (or (org-get-todo-state) ""))
(org-level-face (nth (- (org-outline-level) 1) org-level-faces))
(todo-state (format org-agenda-todo-keyword-format todo)))
(when (null (get-text-property 0 'face headline))
(add-face-text-property 0 (length headline) org-level-face t headline))
(when (null (get-text-property 0 'face todo-state))
(add-face-text-property 0 (length todo-state) (org-get-todo-face todo) t todo-state))
(dashboard-agenda--set-face org-level-face headline)
(dashboard-agenda--set-face (org-get-todo-face todo) todo-state)
(concat todo-state " " headline)))

(defun dashboard-agenda--set-face (face text)
"Add FACE to TEXT but inherit height from `dashboard-items-face'.
If not height is found on FACE or `dashboard-items-face' use `default'."
(let ((height (face-attribute 'dashboard-items-face :height nil 'default)))
(add-face-text-property 0 (length text) `((:height ,height) ,face) nil text)))

(defun dashboard-agenda--formatted-time ()
"Get the scheduled or dead time of an entry. If no time is found return nil."
(when-let ((time (or (org-get-scheduled-time (point)) (org-get-deadline-time (point))
Expand Down