From be04ddc99c8029613566a5da9dd79c5ff6f0882c Mon Sep 17 00:00:00 2001 From: cage Date: Wed, 3 May 2023 16:12:23 +0200 Subject: [PATCH] - [GUI] chaged code to match the new nodgui API related to both modal and non-modal toplevel; - [GUI] fixed callback to make visible the next matched text in a gemtext search. --- src/gui/client/certificates-window.lisp | 9 +++++---- src/gui/client/gui-goodies.lisp | 2 +- src/gui/client/menu-command.lisp | 2 +- src/gui/client/search-frame.lisp | 7 +++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/client/certificates-window.lisp b/src/gui/client/certificates-window.lisp index 23249f5..20a7d85 100644 --- a/src/gui/client/certificates-window.lisp +++ b/src/gui/client/certificates-window.lisp @@ -114,7 +114,7 @@ cert-file key-file) (resync-rows certificate-frame (all-rows)) - (gui:break-mainloop)) + (gui:exit-from-toplevel (gui:master import-window))) (error (e) (client-main-window::notify-request-error e))))))) @@ -175,9 +175,10 @@ :command (import-certificate-clsr object certificate-frame))) (setf cancel-button (make-instance 'gui:button - :text (_ "Cancel") - :master buttons-frame - :command (lambda () (gui:break-mainloop)))) + :text (_ "Cancel") + :master buttons-frame + :command + (lambda () (gui:exit-from-toplevel (gui:master object))))) (gui:grid url-label 0 0) (gui:grid url-entry 1 0) (gui:grid cert-label 3 0) diff --git a/src/gui/client/gui-goodies.lisp b/src/gui/client/gui-goodies.lisp index d8c0991..8664e2e 100644 --- a/src/gui/client/gui-goodies.lisp +++ b/src/gui/client/gui-goodies.lisp @@ -112,7 +112,7 @@ :master toplevel :command (lambda () (setf res (gui-mw:secret-string widget)) - (gui:break-mainloop))))) + (gui:exit-from-modal-toplevel toplevel))))) (gui:grid label 0 0 :sticky :news) (gui:grid widget 1 0 :sticky :news) (gui:grid ok-button 1 1 :sticky :news))) diff --git a/src/gui/client/menu-command.lisp b/src/gui/client/menu-command.lisp index db5bee9..48c6073 100644 --- a/src/gui/client/menu-command.lisp +++ b/src/gui/client/menu-command.lisp @@ -46,7 +46,7 @@ (gui:wait-complete-redraw))))) (defun quit () - (gui:break-mainloop) + (gui:exit-nodgui) (client-events:stop-events-loop) (comm:close-server)) diff --git a/src/gui/client/search-frame.lisp b/src/gui/client/search-frame.lisp index 0be038c..354e715 100644 --- a/src/gui/client/search-frame.lisp +++ b/src/gui/client/search-frame.lisp @@ -45,8 +45,8 @@ (gui:grid case-sensitive-checkbox 0 4 :sticky :nws :padx +minimum-padding+) (gui:grid button-close 0 5 :sticky :ne) (gui:grid-columnconfigure frame 5 :weight 1) - (gui-goodies:attach-tooltips ((button-next frame) (_ "next matched text")) - ((button-previous frame) (_ "previous matched text")) + (gui-goodies:attach-tooltips ((button-next frame) (_ "make next match visible")) + ((button-previous frame) (_ "make previous match visible")) (button-close (_ "end searching"))) (gui:bind (entry frame) #$$ @@ -66,8 +66,7 @@ (lambda () (when (matches frame) (setf (counter frame) (rem (1+ (counter frame)) (length (matches frame)))) - (gui:see gemtext-widget `(:tag ,(gui:match-start (elt (matches frame) (counter frame))) - :first))))) + (gui:see gemtext-widget (gui:match-start (elt (matches frame) (counter frame))))))) (setf (gui:command (button-previous frame)) (lambda () (when (matches frame)