mirror of
https://codeberg.org/cage/tinmop/
synced 2024-12-18 23:22:52 +01:00
- [GUI] improved gemtext search interface.
This commit is contained in:
parent
38ce6cfe91
commit
ea00615a3e
@ -65,20 +65,28 @@
|
|||||||
(gui-goodies:attach-tooltips ((button-next frame) (_ "make next match visible"))
|
(gui-goodies:attach-tooltips ((button-next frame) (_ "make next match visible"))
|
||||||
((button-previous frame) (_ "make previous match visible"))
|
((button-previous frame) (_ "make previous match visible"))
|
||||||
(button-close (_ "end searching")))
|
(button-close (_ "end searching")))
|
||||||
|
(flet ((move-to-search-results (counter-add-function)
|
||||||
|
(if (matches frame)
|
||||||
|
(progn
|
||||||
|
(setf (counter frame) (rem (funcall counter-add-function
|
||||||
|
(counter frame))
|
||||||
|
(length (matches frame))))
|
||||||
|
(gui:see gemtext-widget (gui:match-start (elt (matches frame)
|
||||||
|
(counter frame)))))
|
||||||
|
(client-main-window:print-info-message (format nil
|
||||||
|
(_ "No occurrences of ~s found")
|
||||||
|
(gui:text (entry frame)))))))
|
||||||
(gui:bind (entry frame)
|
(gui:bind (entry frame)
|
||||||
#$<KeyPress-Return>$
|
#$<KeyPress-Return>$
|
||||||
(start-search-clsr frame
|
(lambda (e)
|
||||||
|
(funcall (start-search-clsr frame
|
||||||
gemtext-widget
|
gemtext-widget
|
||||||
(not (gui:value case-sensitive-checkbox))))
|
(not (gui:value case-sensitive-checkbox)))
|
||||||
|
e)
|
||||||
|
(move-to-search-results #'1+)))
|
||||||
(setf (gui:command (button-next frame))
|
(setf (gui:command (button-next frame))
|
||||||
(lambda ()
|
(lambda () (move-to-search-results #'1+)))
|
||||||
(when (matches frame)
|
|
||||||
(setf (counter frame) (rem (1+ (counter frame)) (length (matches frame))))
|
|
||||||
(gui:see gemtext-widget (gui:match-start (elt (matches frame) (counter frame)))))))
|
|
||||||
(setf (gui:command (button-previous frame))
|
(setf (gui:command (button-previous frame))
|
||||||
(lambda ()
|
(lambda () (move-to-search-results #'1-)))
|
||||||
(when (matches frame)
|
|
||||||
(setf (counter frame) (max 0 (1- (counter frame))))
|
|
||||||
(gui:see gemtext-widget (gui:match-start (elt (matches frame) (counter frame)))))))
|
|
||||||
(setf (gui:command button-close) (lambda () (gui:grid-forget frame)))
|
(setf (gui:command button-close) (lambda () (gui:grid-forget frame)))
|
||||||
frame))
|
frame)))
|
||||||
|
Loading…
Reference in New Issue
Block a user