1
0
Fork 0

- [GUI] removed menu shortcuts;

- [GUI] unfocus autocomplete entry when an url has been chosen;

- [GUI] unfocus gemtext window when a link has been clicked.
This commit is contained in:
cage 2023-05-14 16:25:13 +02:00
parent b237e4bd91
commit f2af236b78
1 changed files with 38 additions and 27 deletions

View File

@ -204,12 +204,12 @@
(defun initialize-menu (parent main-window)
(let* ((bar (gui:make-menubar parent))
(file (gui:make-menu bar (_ "File") :underline 0))
(tools (gui:make-menu bar (_ "Tools") :underline 0))
(tour (gui:make-menu bar (_ "Tour") :underline 1))
(bookmarks (gui:make-menu bar (_ "Bookmarks") :underline 0))
(gemlogs (gui:make-menu bar (_ "Gemlogs") :underline 0))
(help (gui:make-menu bar (_ "Help") :underline 0)))
(file (gui:make-menu bar (_ "File")))
(tools (gui:make-menu bar (_ "Tools")))
(tour (gui:make-menu bar (_ "Tour")))
(bookmarks (gui:make-menu bar (_ "Bookmarks")))
(gemlogs (gui:make-menu bar (_ "Gemlogs")))
(help (gui:make-menu bar (_ "Help"))))
(gui:make-menubutton tools
(_ "Certificates")
#'menu:show-certificates
@ -329,6 +329,7 @@
(with-accessors ((iri-entry iri-entry)) tool-bar
(lambda ()
(set-address-bar-text main-window link-value)
(gui:focus (toc-frame main-window))
(open-iri link-value main-window use-cache :status status)))))
(defun absolutize-link (request-iri link-value)
@ -1030,6 +1031,7 @@
#$<KeyPress-Return>$
(lambda (e)
(declare (ignore e))
(gui:focus toc-frame)
(funcall (open-iri-clsr main-window t)))
:append nil)
(gui:bind toc-listbox
@ -1262,32 +1264,38 @@
(client-configuration:get-keybinding :search)
(lambda (e)
(declare (ignore e))
(funcall (menu:show-search-frame-clsr main-window))))
(funcall (menu:show-search-frame-clsr main-window)))
:exclusive t)
(gui:bind (gui:root-toplevel)
(client-configuration:get-keybinding :stream)
(lambda (e)
(declare (ignore e))
(menu:show-streams)))
(menu:show-streams))
:exclusive t)
(gui:bind (gui:root-toplevel)
(client-configuration:get-keybinding :certificates)
(lambda (e)
(declare (ignore e))
(menu:show-certificates)))
(menu:show-certificates))
:exclusive t)
(gui:bind (gui:root-toplevel)
(client-configuration:config-keybinding-tour-manage)
(lambda (e)
(declare (ignore e))
(menu:show-tour)))
(menu:show-tour))
:exclusive t)
(gui:bind (gui:root-toplevel)
(client-configuration:get-keybinding :gemlog)
(lambda (e)
(declare (ignore e))
(menu:manage-gemlogs)))
(menu:manage-gemlogs))
:exclusive t)
(gui:bind (gui:root-toplevel)
(client-configuration:get-keybinding :about)
(lambda (e)
(declare (ignore e))
(menu:help-about)))
(menu:help-about))
:exclusive t)
(gui:bind (gui:root-toplevel)
(client-configuration:get-keybinding :type-address)
(lambda (e)
@ -1295,20 +1303,23 @@
(let* ((autocomplete-entry (iri-entry (tool-bar main-window)))
(entry (nodgui.mw:autocomplete-entry-widget autocomplete-entry)))
(gui:focus entry)
(gui:set-selection entry 0 :end))))
(gui:set-selection entry 0 :end)))
:exclusive t)
(gui:bind (gui:root-toplevel)
(client-configuration:config-keybinding-tour-shuffle)
(lambda (e)
(declare (ignore e))
(client-tour-window:enqueue-shuffle-tour)))
(client-tour-window:enqueue-shuffle-tour))
:exclusive t)
(gui:bind (gui:root-toplevel)
(client-configuration:config-keybinding-tour-next)
(lambda (e)
(declare (ignore e))
(funcall (tour-visit-next-iri-clsr main-window)))))
(funcall (tour-visit-next-iri-clsr main-window)))
:exclusive t))
(defun init-main-window ()
(let ((gui:*debug-tk* nil))
(setf gui:*debug-tk* nil)
(gui:with-nodgui (:title +program-name+)
(icons:load-icons)
(setf gui-goodies:*toplevel* gui:*tk*)
@ -1319,4 +1330,4 @@
(initialize-menu gui:*tk* main-frame)
(gui:grid main-frame 0 0 :sticky :nswe)
(initialize-keybindings main-frame)
(gui-goodies:gui-resize-grid-all gui-goodies:*toplevel*)))))
(gui-goodies:gui-resize-grid-all gui-goodies:*toplevel*))))