Skip to content

Commit

Permalink
refactor(core-ui): make use of +add-hook!
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jul 11, 2023
1 parent 59b4864 commit 3a35113
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions core/me-core-ui.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@

;;; Code:

(defun +theme--tweaks-h (&optional _)
"Use smaller font (75% of the default) for line numbers in graphic mode."
(when (display-graphic-p)
(set-face-attribute
'line-number nil
:background (face-attribute 'default :background)
:height (truncate (* 0.75 (face-attribute 'default :height)))
:weight 'semi-light)
(set-face-attribute
'line-number-current-line nil
:height (truncate (* 0.75 (face-attribute 'default :height)))
:weight 'bold)))

;; Apply tweaks
(add-hook 'after-init-hook #'+theme--tweaks-h)
(add-hook 'enable-theme-functions #'+theme--tweaks-h)
(+add-hook! '(after-init-hook enable-theme-functions)
(defun +theme--tweaks-h (&optional _)
"Use smaller font (75% of the default) for line numbers in graphic mode."
(when (display-graphic-p)
(set-face-attribute
'line-number nil
:background (face-attribute 'default :background)
:height (truncate (* 0.75 (face-attribute 'default :height)))
:weight 'semi-light)
(set-face-attribute
'line-number-current-line nil
:height (truncate (* 0.75 (face-attribute 'default :height)))
:weight 'bold))))

;; Save enabled theme
(add-hook
Expand Down

0 comments on commit 3a35113

Please sign in to comment.