From 342eda7eb2dc683ebc3967818f0007c35e5d3e5f Mon Sep 17 00:00:00 2001 From: cage Date: Sun, 2 Jun 2024 14:46:20 +0200 Subject: [PATCH] - [GUI] ensured to hide window that shows candidates for autocompletion, before a new window (cetrificate, tour etc.) is created. --- src/gui/client/bookmark-window.lisp | 3 ++- src/gui/client/certificates-window.lisp | 3 ++- src/gui/client/gemlog-window.lisp | 1 + src/gui/client/main-window.lisp | 21 ++++++++++++++------- src/gui/client/menu-command.lisp | 14 ++++++++------ src/gui/client/titan-window.lisp | 3 ++- src/gui/client/tour-window.lisp | 3 ++- src/package.lisp | 7 ++++--- 8 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/gui/client/bookmark-window.lisp b/src/gui/client/bookmark-window.lisp index 1b99170..d4ebf62 100644 --- a/src/gui/client/bookmark-window.lisp +++ b/src/gui/client/bookmark-window.lisp @@ -70,7 +70,8 @@ (gui:grid buttons-frame 6 0 :sticky :s :padx +minimum-padding+) (gui:grid add-button 0 0 :sticky :s)))) -(defun init-window (master iri) +(defun init-window (master main-window iri) + (client-main-window:hide-autocomplete-candidates main-window) (make-edit-window master iri)) (defun bookmarks-table->lisbox-items (bookmarks-table) diff --git a/src/gui/client/certificates-window.lisp b/src/gui/client/certificates-window.lisp index 8596603..e50b64f 100644 --- a/src/gui/client/certificates-window.lisp +++ b/src/gui/client/certificates-window.lisp @@ -256,7 +256,8 @@ :master toplevel))) (gui:grid frame 0 0 :sticky :news))))) -(defun init-window (master) +(defun init-window (master main-window) + (client-main-window:hide-autocomplete-candidates main-window) (gui:with-toplevel (toplevel :master master :title (_ "Certificates")) (gui:transient toplevel master) (let* ((table (make-instance 'certificate-frame :master toplevel)) diff --git a/src/gui/client/gemlog-window.lisp b/src/gui/client/gemlog-window.lisp index 9a845fc..5b8772e 100644 --- a/src/gui/client/gemlog-window.lisp +++ b/src/gui/client/gemlog-window.lisp @@ -160,6 +160,7 @@ (gui:popup popup-menu x y))))) (defun init-window (master main-window) + (client-main-window:hide-autocomplete-candidates main-window) (gui:with-toplevel (toplevel :master master :title (_ "Gemlogs")) (let* ((table (make-instance 'gemlog-frame :master toplevel)) (buttons-frame (make-instance 'gui:frame :master toplevel)) diff --git a/src/gui/client/main-window.lisp b/src/gui/client/main-window.lisp index 9751718..fc763e7 100644 --- a/src/gui/client/main-window.lisp +++ b/src/gui/client/main-window.lisp @@ -241,7 +241,7 @@ (help (gui:make-menu bar (_ "Help")))) (gui:make-menubutton tools (_ "Certificates") - #'menu:show-certificates + (menu:show-certificates-clsr main-window) :accelerator (client-configuration:get-keybinding :certificates)) (gui:make-menubutton tools (_ "Search") @@ -278,7 +278,7 @@ (gui:make-menubutton bookmarks (_ "Manage") (menu:manage-bookmarks-clsr main-window)) (gui:make-menubutton tour (_ "Manage") - #'menu:show-tour + (menu:show-tour-clsr main-window) :accelerator (client-configuration:config-keybinding-tour-manage)) (gui:make-menubutton tour (_ "Shuffle") @@ -620,7 +620,9 @@ local file paths." (_ "~s already bookmarked") link-value) :bold t) - (client-bookmark-window:init-window main-window link-value)))) + (client-bookmark-window:init-window main-window + main-window + link-value)))) (open-inline-clsr (line-number) (lambda () (if (inline-possible-p link-value) @@ -1089,7 +1091,7 @@ local file paths." ((iri:iri= actual-iri (internal-iri-gemlogs)) (menu:manage-gemlogs)) ((gemini-client:absolute-titan-url-p actual-iri) - (client-titan-window:init-window main-window actual-iri)) + (client-titan-window:init-window main-window main-window actual-iri)) ((gemini-parser:gemini-iri-p actual-iri) (let ((stream-frame (stream-frame main-window))) (start-stream-iri (iri-ensure-path actual-iri) @@ -1411,7 +1413,9 @@ local file paths." (ev:with-enqueued-process-and-unblock () (comm:make-request :gemini-bookmark-delete 1 iri) (set-bookmark-button-false main-window)) - (client-bookmark-window:init-window main-window (gui:text iri-entry)))))))) + (client-bookmark-window:init-window main-window + main-window + (gui:text iri-entry)))))))) (defun toggle-subscribtion-iri-clsr (main-window) (lambda () @@ -1872,13 +1876,13 @@ local file paths." (client-configuration:get-keybinding :certificates) (lambda (e) (declare (ignore e)) - (menu:show-certificates)) + (funcall (menu:show-certificates-clsr main-window))) :exclusive t) (gui:bind target (client-configuration:config-keybinding-tour-manage) (lambda (e) (declare (ignore e)) - (menu:show-tour)) + (funcall (menu:show-tour-clsr main-window))) :exclusive t) (gui:bind target (client-configuration:get-keybinding :gemlog) @@ -1999,3 +2003,6 @@ local file paths." (set-address-bar-text main-frame starting-iri))) (open-iri starting-iri main-frame nil)) (client-scheduler:start)))) + +(defun hide-autocomplete-candidates (main-window) + (gui-mw:hide-candidates (iri-entry (tool-bar main-window)))) diff --git a/src/gui/client/menu-command.lisp b/src/gui/client/menu-command.lisp index bdc6cc1..0449bbf 100644 --- a/src/gui/client/menu-command.lisp +++ b/src/gui/client/menu-command.lisp @@ -50,9 +50,10 @@ (client-events:stop-events-loop) (comm:close-server)) -(defun show-certificates () - (let ((master gui-goodies:*toplevel*)) - (client-certificates-window:init-window master))) +(defun show-certificates-clsr (main-window) + (lambda () + (let ((master gui-goodies:*toplevel*)) + (client-certificates-window:init-window master main-window)))) (defun show-streams () (let* ((master gui-goodies:*main-frame*) @@ -129,9 +130,10 @@ (gui:grid (client-main-window::search-frame main-window) 2 0 :sticky :news) (gui:focus (client-search-frame::entry (client-main-window::search-frame main-window))))) -(defun show-tour () - (let ((master gui-goodies:*toplevel*)) - (client-tour-window:init-window master))) +(defun show-tour-clsr (main-window) + (lambda () + (let ((master gui-goodies:*toplevel*)) + (client-tour-window:init-window master main-window)))) (defun manage-gemlogs () (let ((master gui-goodies:*toplevel*) diff --git a/src/gui/client/titan-window.lisp b/src/gui/client/titan-window.lisp index 6c1b7b3..69ac5ec 100644 --- a/src/gui/client/titan-window.lisp +++ b/src/gui/client/titan-window.lisp @@ -230,7 +230,8 @@ (gui:grid ok-button 0 0) (gui:grid cancel-button 0 1)))) -(defun init-window (master &optional (titan-url nil)) +(defun init-window (master main-window &optional (titan-url nil)) + (client-main-window:hide-autocomplete-candidates main-window) (gui:with-toplevel (toplevel :master master :title (_ "Titan request window")) (gui:transient toplevel master) (let* ((frame (make-instance 'titan-frame diff --git a/src/gui/client/tour-window.lisp b/src/gui/client/tour-window.lisp index 149e242..b5f1a0b 100644 --- a/src/gui/client/tour-window.lisp +++ b/src/gui/client/tour-window.lisp @@ -64,7 +64,8 @@ (let ((new-rows (all-rows))) (resync-rows tour-frame new-rows)))) -(defun init-window (master) +(defun init-window (master main-window) + (client-main-window:hide-autocomplete-candidates main-window) (gui:with-toplevel (toplevel :master master :title (_ "Tour")) (gui:transient toplevel master) (let* ((table (make-instance 'tour-frame :master toplevel)) diff --git a/src/package.lisp b/src/package.lisp index 62934c3..bc6933f 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -3552,14 +3552,14 @@ (:export :help-about :quit - :show-certificates + :show-certificates-clsr :show-streams :show-bookmarks-clsr :export-bookmarks-clsr :import-bookmarks-clsr :manage-bookmarks-clsr :show-search-frame-clsr - :show-tour + :show-tour-clsr :manage-gemlogs :show-page-source-clsr)) @@ -3750,7 +3750,8 @@ :print-info-message :make-internal-iri :internal-iri-bookmark - :show-bookmarks-page)) + :show-bookmarks-page + :hide-autocomplete-candidates)) (defpackage :main (:use