mirror of https://codeberg.org/cage/tinmop/
- added exclusive gemini client UI layout.
This commit is contained in:
parent
63ee43ad3f
commit
7b8581c5e4
|
@ -853,7 +853,8 @@ than (swconf:config-purge-history-days-offset) days in the past"
|
||||||
(mapcar #'second
|
(mapcar #'second
|
||||||
(query (select :input
|
(query (select :input
|
||||||
(from +table-input-history+)
|
(from +table-input-history+)
|
||||||
(where (:= :prompt prompt))))))
|
(where (:= :prompt prompt))
|
||||||
|
(order-by (:desc :id))))))
|
||||||
|
|
||||||
(defmethod prepare-for-db ((object tooter:application) &key &allow-other-keys)
|
(defmethod prepare-for-db ((object tooter:application) &key &allow-other-keys)
|
||||||
(tooter:name object))
|
(tooter:name object))
|
||||||
|
@ -1889,6 +1890,8 @@ row."
|
||||||
|
|
||||||
(gen-access-message-row cover :cover)
|
(gen-access-message-row cover :cover)
|
||||||
|
|
||||||
|
(gen-access-message-row input :input)
|
||||||
|
|
||||||
(defun row-votes-count (row)
|
(defun row-votes-count (row)
|
||||||
(and row (db-getf row :votes-count :default 0)))
|
(and row (db-getf row :votes-count :default 0)))
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,10 @@
|
||||||
(bg (swconf:background theme-style))
|
(bg (swconf:background theme-style))
|
||||||
(selected-fg (swconf:selected-foreground theme-style))
|
(selected-fg (swconf:selected-foreground theme-style))
|
||||||
(selected-bg (swconf:selected-background theme-style))
|
(selected-bg (swconf:selected-background theme-style))
|
||||||
(width (- (win-width *main-window*)
|
(width (if command-line:*gemini-full-screen-mode*
|
||||||
(win-width *thread-window*)))
|
(truncate (* 1/4 (win-width *main-window*)))
|
||||||
|
(- (win-width *main-window*)
|
||||||
|
(win-width *thread-window*))))
|
||||||
(raw-height (swconf:win-height swconf:+key-gemini-toc-window+))
|
(raw-height (swconf:win-height swconf:+key-gemini-toc-window+))
|
||||||
(height (- (main-window:parse-subwin-h raw-height)
|
(height (- (main-window:parse-subwin-h raw-height)
|
||||||
(win-height *command-window*)))
|
(win-height *command-window*)))
|
||||||
|
@ -112,4 +114,7 @@
|
||||||
(hooks:add-hook 'hooks:*before-rendering-message-visible-rows*
|
(hooks:add-hook 'hooks:*before-rendering-message-visible-rows*
|
||||||
#'highlight-current-section)
|
#'highlight-current-section)
|
||||||
(draw *gemini-toc-window*)
|
(draw *gemini-toc-window*)
|
||||||
|
(when command-line:*gemini-full-screen-mode*
|
||||||
|
(refresh-config specials:*message-window*)
|
||||||
|
(draw *message-window*))
|
||||||
*gemini-toc-window*))
|
*gemini-toc-window*))
|
||||||
|
|
|
@ -136,18 +136,24 @@ etc.) happened"
|
||||||
(main-window:init)
|
(main-window:init)
|
||||||
(keybindings-window:init)
|
(keybindings-window:init)
|
||||||
(command-window:init)
|
(command-window:init)
|
||||||
(thread-window:init)
|
(when (not command-line:*gemini-full-screen-mode*)
|
||||||
|
(thread-window:init))
|
||||||
;; the size of message and tag window depends from the sizes of
|
;; the size of message and tag window depends from the sizes of
|
||||||
;; thread-window and command window, so the first two must be
|
;; thread-window and command window, so the first two must be
|
||||||
;; initialized after the latter
|
;; initialized after the latter
|
||||||
(message-window:init)
|
(message-window:init)
|
||||||
(tags-window:init)
|
(when (not command-line:*gemini-full-screen-mode*)
|
||||||
|
(tags-window:init)
|
||||||
|
(conversations-window:init))
|
||||||
(gemini-client:init-default-gemini-theme specials:*message-window*)
|
(gemini-client:init-default-gemini-theme specials:*message-window*)
|
||||||
(conversations-window:init)
|
|
||||||
(setup-bindings)
|
(setup-bindings)
|
||||||
;; ... and init-keyboard-mapping-for last
|
;; ... and init-keyboard-mapping-for last
|
||||||
(keybindings:init-keyboard-mapping)
|
(keybindings:init-keyboard-mapping)
|
||||||
(ui:focus-to-thread-window)
|
(if command-line:*gemini-full-screen-mode*
|
||||||
|
(progn
|
||||||
|
(ui:display-latest-visited-urls)
|
||||||
|
(ui:focus-to-message-window))
|
||||||
|
(ui:focus-to-thread-window))
|
||||||
;; now init the client
|
;; now init the client
|
||||||
(client:init)
|
(client:init)
|
||||||
(client:authorize)
|
(client:authorize)
|
||||||
|
|
|
@ -100,19 +100,35 @@
|
||||||
:bgcolor mark-bg))))
|
:bgcolor mark-bg))))
|
||||||
|
|
||||||
(defmethod refresh-config :after ((object message-window))
|
(defmethod refresh-config :after ((object message-window))
|
||||||
(refresh-config-colors object swconf:+key-message-window+)
|
(refresh-config-colors object swconf:+key-message-window+)
|
||||||
(refresh-line-mark-config object)
|
(refresh-line-mark-config object)
|
||||||
(let* ((thread-window-width (win-width *thread-window*))
|
(let* ((reference-window (if command-line:*gemini-full-screen-mode*
|
||||||
(thread-window-height (win-height *thread-window*))
|
*main-window*
|
||||||
(command-window-height (win-height *command-window*))
|
*thread-window*))
|
||||||
(main-window-height (win-height *main-window*))
|
(reference-window-width (if (and command-line:*gemini-full-screen-mode*
|
||||||
(height (- main-window-height
|
*gemini-toc-window*)
|
||||||
command-window-height
|
(- (win-width *main-window*)
|
||||||
thread-window-height))
|
(win-width *gemini-toc-window*))
|
||||||
(width thread-window-width)
|
(win-width reference-window)))
|
||||||
(x (win-x *thread-window*))
|
(reference-window-height (win-height reference-window))
|
||||||
(y (+ (win-y *thread-window*)
|
(command-window-height (win-height *command-window*))
|
||||||
thread-window-height)))
|
(main-window-height (win-height *main-window*))
|
||||||
|
(height (if (eq reference-window *thread-window*)
|
||||||
|
(- main-window-height
|
||||||
|
command-window-height
|
||||||
|
reference-window-height)
|
||||||
|
(- main-window-height
|
||||||
|
command-window-height)))
|
||||||
|
(width reference-window-width)
|
||||||
|
(x (if (and command-line:*gemini-full-screen-mode*
|
||||||
|
*gemini-toc-window*)
|
||||||
|
(win-width *gemini-toc-window*)
|
||||||
|
(win-x reference-window)))
|
||||||
|
(y (if (or command-line:*gemini-full-screen-mode*
|
||||||
|
*gemini-toc-window*)
|
||||||
|
0
|
||||||
|
(+ (win-y reference-window)
|
||||||
|
reference-window-height))))
|
||||||
(win-resize object width height)
|
(win-resize object width height)
|
||||||
(win-move object x y)))
|
(win-move object x y)))
|
||||||
|
|
||||||
|
@ -680,11 +696,16 @@
|
||||||
(defun gemini-toc-group-id (fields)
|
(defun gemini-toc-group-id (fields)
|
||||||
(getf fields :group-id))
|
(getf fields :group-id))
|
||||||
|
|
||||||
|
(defun message-window-title ()
|
||||||
|
(if command-line:*gemini-full-screen-mode*
|
||||||
|
(_ "Gemini stream")
|
||||||
|
(_ "Messages")))
|
||||||
|
|
||||||
(defun init ()
|
(defun init ()
|
||||||
(let* ((low-level-window (make-croatoan-window :enable-function-keys t)))
|
(let* ((low-level-window (make-croatoan-window :enable-function-keys t)))
|
||||||
(setf *message-window*
|
(setf *message-window*
|
||||||
(make-instance 'message-window
|
(make-instance 'message-window
|
||||||
:title (_ "Messages")
|
:title (message-window-title)
|
||||||
:keybindings keybindings:*message-keymap*
|
:keybindings keybindings:*message-keymap*
|
||||||
:key-config swconf:+key-message-window+
|
:key-config swconf:+key-message-window+
|
||||||
:croatoan-window low-level-window))
|
:croatoan-window low-level-window))
|
||||||
|
|
|
@ -931,6 +931,7 @@
|
||||||
:row-license
|
:row-license
|
||||||
:row-version
|
:row-version
|
||||||
:row-cover
|
:row-cover
|
||||||
|
:row-input
|
||||||
:next-status-tree
|
:next-status-tree
|
||||||
:previous-status-tree
|
:previous-status-tree
|
||||||
:message-tree-root-equal
|
:message-tree-root-equal
|
||||||
|
@ -2716,6 +2717,7 @@
|
||||||
:bookmark-gemini-page
|
:bookmark-gemini-page
|
||||||
:display-bookmark
|
:display-bookmark
|
||||||
:delete-gemini-bookmark
|
:delete-gemini-bookmark
|
||||||
|
:display-latest-visited-urls
|
||||||
:open-gempub-library
|
:open-gempub-library
|
||||||
:gempub-library-window-move
|
:gempub-library-window-move
|
||||||
:gempub-library-window-go-up
|
:gempub-library-window-go-up
|
||||||
|
|
|
@ -1094,7 +1094,7 @@
|
||||||
(uri:normalize-path (fs:prepend-pwd path)))
|
(uri:normalize-path (fs:prepend-pwd path)))
|
||||||
|
|
||||||
(defun render-directory-as-gemini-text (root-directory)
|
(defun render-directory-as-gemini-text (root-directory)
|
||||||
(let* ((index-path ( relative-path->absolute root-directory))
|
(let* ((index-path (relative-path->absolute root-directory))
|
||||||
(all-paths (mapcar #'uri:normalize-path
|
(all-paths (mapcar #'uri:normalize-path
|
||||||
(fs:collect-children index-path)))
|
(fs:collect-children index-path)))
|
||||||
(link-lines ())
|
(link-lines ())
|
||||||
|
|
|
@ -533,7 +533,10 @@ current has focus"
|
||||||
(gen-focus-to-window message-window
|
(gen-focus-to-window message-window
|
||||||
*message-window*
|
*message-window*
|
||||||
:documentation "Move focus on message window"
|
:documentation "Move focus on message window"
|
||||||
:info-change-focus-message (_ "Focus passed on message window"))
|
:info-change-focus-message
|
||||||
|
(if (message-window:gemini-window-p)
|
||||||
|
(_ "Focus passed on gemini stream window")
|
||||||
|
(_ "Focus passed on message window")))
|
||||||
|
|
||||||
(gen-focus-to-window send-message-window
|
(gen-focus-to-window send-message-window
|
||||||
*send-message-window*
|
*send-message-window*
|
||||||
|
@ -2126,7 +2129,9 @@ gemini page the program is rendering."
|
||||||
(defun gemini-toc-close ()
|
(defun gemini-toc-close ()
|
||||||
(hooks:remove-hook 'hooks:*before-rendering-message-visible-rows*
|
(hooks:remove-hook 'hooks:*before-rendering-message-visible-rows*
|
||||||
#'gemini-page-toc:highlight-current-section)
|
#'gemini-page-toc:highlight-current-section)
|
||||||
(close-window-and-return-to-message *gemini-toc-window*))
|
(close-window-and-return-to-message *gemini-toc-window*)
|
||||||
|
(windows:refresh-config *message-window*)
|
||||||
|
(windows:draw *message-window*))
|
||||||
|
|
||||||
(defun gemini-toc-scroll-down-page ()
|
(defun gemini-toc-scroll-down-page ()
|
||||||
(message-window:scroll-down *message-window*))
|
(message-window:scroll-down *message-window*))
|
||||||
|
@ -2256,6 +2261,20 @@ gemini page the program is rendering."
|
||||||
:payload bookmark-page)))
|
:payload bookmark-page)))
|
||||||
(push-event event)))
|
(push-event event)))
|
||||||
|
|
||||||
|
(defun generate-latest-visited-url ()
|
||||||
|
(let ((history (db:history-prompt->values (gemini-open-url-prompt))))
|
||||||
|
(with-output-to-string (stream)
|
||||||
|
(format stream (gemini-parser:geminize-h1 (_ "Latest visited addresses~2%")))
|
||||||
|
(loop for iri in history when (gemini-client:absolute-gemini-url-p iri) do
|
||||||
|
(format stream "~a~%" (gemini-parser:geminize-link iri))))))
|
||||||
|
|
||||||
|
(defun display-latest-visited-urls ()
|
||||||
|
(let* ((bookmark-page (generate-latest-visited-url))
|
||||||
|
(event (make-instance 'gemini-display-data-page
|
||||||
|
:window *message-window*
|
||||||
|
:payload bookmark-page)))
|
||||||
|
(push-event event)))
|
||||||
|
|
||||||
(defun delete-gemini-bookmark ()
|
(defun delete-gemini-bookmark ()
|
||||||
(flet ((on-description-completed (selected)
|
(flet ((on-description-completed (selected)
|
||||||
(if (text-utils:string-empty-p selected)
|
(if (text-utils:string-empty-p selected)
|
||||||
|
|
Loading…
Reference in New Issue