Refactor doom-dashboard-draw-ascii-banner-fn

This commit is contained in:
Henrik Lissner 2020-11-18 19:57:38 -05:00
parent 03fe396eea
commit 86c2f05252
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -385,29 +385,37 @@ controlled by `+doom-dashboard-pwd-policy'."
;;; Widgets ;;; Widgets
(defun doom-dashboard-draw-ascii-banner-fn () (defun doom-dashboard-draw-ascii-banner-fn ()
(mapc (lambda (line) (let* ((banner
(insert (propertize (+doom-dashboard--center +doom-dashboard--width line) '("================= =============== =============== ======== ========"
'face 'doom-dashboard-banner) " ") "\\\\ . . . . . . .\\\\ //. . . . . . .\\\\ //. . . . . . .\\\\ \\\\. . .\\\\// . . //"
(insert "\n")) "||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||"
'("================= =============== =============== ======== ========" "|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||"
"\\\\ . . . . . . .\\\\ //. . . . . . .\\\\ //. . . . . . .\\\\ \\\\. . .\\\\// . . //" "||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||"
"||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||" "|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\\ . . . . ||"
"|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||" "||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\\_ . .|. .||"
"||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||" "|| . _|| || || || || ||_ . || || . _|| || || || |\\ `-_/| . ||"
"|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\\ . . . . ||" "||_-' || .|/ || || \\|. || `-_|| ||_-' || .|/ || || | \\ / |-_.||"
"||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\\_ . .|. .||" "|| ||_-' || || `-_|| || || ||_-' || || | \\ / | `||"
"|| . _|| || || || || ||_ . || || . _|| || || || |\\ `-_/| . ||" "|| `' || || `' || || `' || || | \\ / | ||"
"||_-' || .|/ || || \\|. || `-_|| ||_-' || .|/ || || | \\ / |-_.||" "|| .===' `===. .==='.`===. .===' /==. | \\/ | ||"
"|| ||_-' || || `-_|| || || ||_-' || || | \\ / | `||" "|| .==' \\_|-_ `===. .===' _|_ `===. .===' _-|/ `== \\/ | ||"
"|| `' || || `' || || `' || || | \\ / | ||" "|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \\/ | ||"
"|| .===' `===. .==='.`===. .===' /==. | \\/ | ||" "|| .==' _-' '-__\\._-' '-_./__-' `' |. /| | ||"
"|| .==' \\_|-_ `===. .===' _|_ `===. .===' _-|/ `== \\/ | ||" "||.==' _-' `' | /==.||"
"|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \\/ | ||" "==' _-' E M A C S \\/ `=="
"|| .==' _-' '-__\\._-' '-_./__-' `' |. /| | ||" "\\ _-' `-_ /"
"||.==' _-' `' | /==.||" "`'' ``'"))
"==' _-' E M A C S \\/ `==" (longest-line (apply #'max (mapcar #'length banner))))
"\\ _-' `-_ /" (put-text-property
"`'' ``'"))) (point)
(dolist (line banner (point))
(insert (+doom-dashboard--center
+doom-dashboard--width
(concat
line (make-string (max 0 (- longest-line (length line)))
32)))
"\n"))
'face 'doom-dashboard-banner)))
(defun doom-dashboard-widget-banner () (defun doom-dashboard-widget-banner ()
(let ((point (point))) (let ((point (point)))