app/calendar: general refactor

This commit is contained in:
Henrik Lissner 2018-02-19 15:18:36 -05:00
parent 4cd79bd6ca
commit 04cb9a2691
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 46 additions and 34 deletions

View file

@ -14,11 +14,13 @@
;;;###autoload
(defun +calendar/quit ()
"TODO"
(interactive)
(+workspace/delete "Calendar"))
;;;###autoload
(defun +calendar/open-calendar ()
"TODO"
(interactive)
(cfw:open-calendar-buffer
;; :custom-map cfw:my-cal-map
@ -27,3 +29,17 @@
(cfw:org-create-source (doom-color 'fg)) ; orgmode source
)))
;;;###autoload
(defun +calendar*cfw:render-button (title command &optional state)
"render-button
TITLE
COMMAND
STATE"
(let ((text (concat " " title " "))
(keymap (make-sparse-keymap)))
(cfw:rt text (if state 'cfw:face-toolbar-button-on
'cfw:face-toolbar-button-off))
(define-key keymap [mouse-1] command)
(cfw:tp text 'keymap keymap)
(cfw:tp text 'mouse-face 'highlight)
text))