mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-08 07:08:39 +01:00
- moved 'global bindings' to the gemtext widget.
This commit is contained in:
parent
56dd0798a6
commit
2f26583f78
@ -126,10 +126,13 @@
|
||||
(fit-toc-char-width main-window toc-widget-width)))
|
||||
main-window)))
|
||||
|
||||
(defun slurp-gemini-stream (main-window iri stream-wrapper &key
|
||||
(defun slurp-gemini-stream (main-window iri stream-wrapper
|
||||
&key
|
||||
(use-cache t)
|
||||
(process-function #'identity)
|
||||
(aborting-function (constantly nil)))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(set-focus-to-gemtext main-window))
|
||||
(enqueue-request-notify-error :gemini-request 1 iri use-cache)
|
||||
(labels ((stream-exausted-p ()
|
||||
(let ((status-completed (comm:make-request :gemini-stream-completed-p
|
||||
@ -1071,12 +1074,6 @@
|
||||
(gui:bind toc-listbox
|
||||
#$<<ListboxSelect>>$
|
||||
(toc-callback-clsr main-window))
|
||||
(gui:bind gemtext-widget
|
||||
#$<Enter>$
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(gui:configure-mouse-pointer gemtext-widget (gui:find-cursor :xterm))
|
||||
(gui:force-focus (gui:root-toplevel))))
|
||||
(setf (gui:command go-button) (open-iri-clsr main-window t))
|
||||
(setf (gui:command reload-button) (reload-iri-clsr main-window))
|
||||
(setf (gui:command back-button) (back-iri-clsr main-window))
|
||||
@ -1325,52 +1322,56 @@
|
||||
(setf (gui:text (iri-entry (tool-bar main-window))) text)
|
||||
(gui:clear-selection entry)))
|
||||
|
||||
(defun set-focus-to-gemtext (main-window)
|
||||
(gui:focus (gui:inner-text (gemtext-widget main-window))))
|
||||
|
||||
(defun get-address-bar-text (main-window)
|
||||
(trim-blanks (gui:text (iri-entry (tool-bar main-window)))))
|
||||
|
||||
(defun initialize-keybindings (main-window)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(let ((inner-gemtext-widget (gui:inner-text (gemtext-widget main-window))))
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :quit)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:quit)))
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :search)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (menu:show-search-frame-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :stream)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-streams))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :certificates)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-certificates))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-tour-manage)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:show-tour))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :gemlog)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:manage-gemlogs))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :about)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:help-about))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :type-address)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
@ -1379,42 +1380,41 @@
|
||||
(gui:focus entry)
|
||||
(gui:set-selection entry 0 :end)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-tour-shuffle)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(client-tour-window:enqueue-shuffle-tour))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-tour-next)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (tour-visit-next-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :back)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (back-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:get-keybinding :up)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (up-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-bookmark-toggle)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (toggle-bookmark-iri-clsr main-window)))
|
||||
:exclusive t)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(gui:bind inner-gemtext-widget
|
||||
(client-configuration:config-keybinding-bookmark-show)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (menu:show-bookmarks-clsr main-window)))
|
||||
:exclusive t))
|
||||
(funcall (menu:show-bookmarks-clsr main-window))))))
|
||||
|
||||
(defun init-main-window (starting-iri)
|
||||
(setf gui:*debug-tk* nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user