Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
ui-updates macro to 'ui-update
Browse files Browse the repository at this point in the history
  • Loading branch information
vlnx committed Jun 17, 2015
1 parent 87da721 commit 6193052
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
16 changes: 8 additions & 8 deletions core/tabs.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@

(setf (getf *hooks* :switch-page)
(list #'(lambda (browser)
(ui-update browser :history t)
(ui-update browser :progress t)
(ui-update browser :scroll-indicator t)
(ui-update browser :link-hover "")
(ui-update browser
:tabs-update-title (current-tab browser))
(ui-update browser :current-tab t)
(ui-update browser :uri t))))
(ui-updates browser
:history t
:progress t
:scroll-indicator t
:link-hover ""
:tabs-update-title (current-tab browser)
:current-tab t
:uri t))))

(defcallback notebook-switch-page :void
((notebook pobject)
Expand Down
5 changes: 5 additions & 0 deletions core/ui-update.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

(defgeneric ui-update (browser symbol value))

(defmacro ui-updates (browser &rest plist)
(append '(progn)
(loop for item in (pair-plist plist)
collect `(ui-update ,browser ,@item))))

(defun escape-single-quote (str)
(ppcre:regex-replace-all "'" str "\\\\'"))

Expand Down
12 changes: 6 additions & 6 deletions site/ui/status/status.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
(run-hook :prompt-leave b))

(defexport statusbar-init (b)
(ui-update b :uri t)
(ui-update b :scroll-indicator t)
(ui-update b :progress t)
(ui-update b :history t)
(ui-update b :keymode t)
(ui-update b :current-tab t))
(ui-updates b :uri t
:scroll-indicator t
:progress t
:history t
:keymode t
:current-tab t))

(defexport quit ()
(sb-ext:exit :abort t))
Expand Down
4 changes: 2 additions & 2 deletions site/ui/tabs/tabs.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
`(-1 ,height))))))

(defexport tabs-init (b)
(ui-update b :tabs-reset-list t)
(ui-update b :current-tab t))
(ui-updates b :tabs-reset-list t
:current-tab t))

(defscript (ui-symbol-to-uri 'tabs)
:exports (tabbar-request-height
Expand Down

0 comments on commit 6193052

Please sign in to comment.