mirror of https://codeberg.org/cage/tinmop/
Compare commits
4 Commits
b91c0786e8
...
94fad84387
Author | SHA1 | Date |
---|---|---|
cage | 94fad84387 | |
cage | e070f89b05 | |
cage | 93dd9b1c11 | |
cage | 4dfa362c0f |
|
@ -123,30 +123,29 @@
|
|||
(client-configuration:config-icons-scaling))))
|
||||
|
||||
(defun load-icons ()
|
||||
(let ((nodgui:*use-tk-for-decoding-png* t))
|
||||
(setf *search* (load-icon +search+))
|
||||
(setf *back* (load-icon +back+))
|
||||
(setf *open-iri* (load-icon +go+))
|
||||
(setf *open-tour* (load-icon +open-tour+))
|
||||
(setf *refresh* (load-icon +refresh+))
|
||||
(setf *up* (load-icon +up+))
|
||||
(setf *document-delete* (load-icon +document-delete+))
|
||||
(setf *document-add* (load-icon +document-add+))
|
||||
(setf *document-accept* (load-icon +document-accept+))
|
||||
(setf *document-edit* (load-icon +document-edit+))
|
||||
(setf *folder* (load-icon +folder+))
|
||||
(setf *star-yellow* (load-icon +star-yellow+))
|
||||
(setf *star-blue* (load-icon +star-blue+))
|
||||
(setf *arrow-up* (load-icon +arrow-up+))
|
||||
(setf *arrow-down* (load-icon +arrow-down+))
|
||||
(setf *cross* (load-icon +cross+))
|
||||
(setf *bus-go* (load-icon +bus-go+))
|
||||
(setf *dice* (load-icon +dice+))
|
||||
(setf *gemlog-subscribe* (load-icon +gemlog-subscribe+))
|
||||
(setf *gemlog-unsubscribe* (load-icon +gemlog-unsubscribe+))
|
||||
(setf *inline-images* (load-icon +inline-images+))
|
||||
(setf *text* (load-icon +text+))
|
||||
(setf *profile* (load-icon +profile+))
|
||||
(setf *profile-disabled* (disable-icon +profile+))
|
||||
(setf *toc* (load-icon +toc+))
|
||||
(setf *toc-disabled* (disable-icon +toc+))))
|
||||
(setf *search* (load-icon +search+))
|
||||
(setf *back* (load-icon +back+))
|
||||
(setf *open-iri* (load-icon +go+))
|
||||
(setf *open-tour* (load-icon +open-tour+))
|
||||
(setf *refresh* (load-icon +refresh+))
|
||||
(setf *up* (load-icon +up+))
|
||||
(setf *document-delete* (load-icon +document-delete+))
|
||||
(setf *document-add* (load-icon +document-add+))
|
||||
(setf *document-accept* (load-icon +document-accept+))
|
||||
(setf *document-edit* (load-icon +document-edit+))
|
||||
(setf *folder* (load-icon +folder+))
|
||||
(setf *star-yellow* (load-icon +star-yellow+))
|
||||
(setf *star-blue* (load-icon +star-blue+))
|
||||
(setf *arrow-up* (load-icon +arrow-up+))
|
||||
(setf *arrow-down* (load-icon +arrow-down+))
|
||||
(setf *cross* (load-icon +cross+))
|
||||
(setf *bus-go* (load-icon +bus-go+))
|
||||
(setf *dice* (load-icon +dice+))
|
||||
(setf *gemlog-subscribe* (load-icon +gemlog-subscribe+))
|
||||
(setf *gemlog-unsubscribe* (load-icon +gemlog-unsubscribe+))
|
||||
(setf *inline-images* (load-icon +inline-images+))
|
||||
(setf *text* (load-icon +text+))
|
||||
(setf *profile* (load-icon +profile+))
|
||||
(setf *profile-disabled* (disable-icon +profile+))
|
||||
(setf *toc* (load-icon +toc+))
|
||||
(setf *toc-disabled* (disable-icon +toc+)))
|
||||
|
|
|
@ -2045,7 +2045,17 @@ local file paths."
|
|||
|
||||
(defun scale-gemtext (main-window offset)
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(let ((saved-active-stream (find-streaming-stream-url)))
|
||||
(let* ((saved-active-stream (find-streaming-stream-url))
|
||||
(gemtext-widget (gemtext-widget main-window))
|
||||
(saved-visible-portion (gui:y-visible-portion gemtext-widget))
|
||||
(saved-start-visible-portion (getf saved-visible-portion :start))
|
||||
(gemtext-y (gui:root-y gemtext-widget))
|
||||
(saved-pixel-y (truncate (- (* saved-start-visible-portion
|
||||
(gui:window-height gemtext-widget))
|
||||
gemtext-y)))
|
||||
(saved-pixel-indices `(:x 0 :y ,saved-pixel-y))
|
||||
(saved-line-index (gui:index->line-char-coordinates gemtext-widget
|
||||
saved-pixel-indices)))
|
||||
(interrupt-rendering main-window)
|
||||
(maybe-stop-streaming-stream-thread)
|
||||
(when saved-active-stream
|
||||
|
@ -2061,7 +2071,8 @@ local file paths."
|
|||
1.0))
|
||||
(render-ir-lines (get-address-bar-text main-window) main-window)
|
||||
(when contains-inlined-images
|
||||
(inline-all-images main-window))))))
|
||||
(inline-all-images main-window))
|
||||
(gui:scroll-to gemtext-widget `(:line ,saved-line-index :char 0))))))
|
||||
|
||||
(defun initialize-keybindings (main-window target)
|
||||
(gui:bind target
|
||||
|
|
|
@ -405,7 +405,8 @@
|
|||
(null (iri:host iri)))))
|
||||
|
||||
(defun absolute-url-p (url)
|
||||
(not (relative-url-p url)))
|
||||
(and (not (relative-url-p url))
|
||||
(iri:iri-parse url :null-on-error t)))
|
||||
|
||||
(defun absolute-url-scheme-p (url expected-scheme)
|
||||
(when-let ((parsed-iri (iri:iri-parse url :null-on-error t)))
|
||||
|
|
|
@ -749,15 +749,15 @@ printed in the box column by column; in the example above the results are:
|
|||
constants:+internal-scheme-local-posts+)))
|
||||
"Collect all hyperlinks in a text marked from a list of valid `schemes'"
|
||||
(flet ((build-re-scheme ()
|
||||
(let ((res ""))
|
||||
(let ((res "^"))
|
||||
(loop for (scheme . rest) on schemes do
|
||||
(if rest
|
||||
(setf res (strcat res "(" scheme ")|"))
|
||||
(setf res (strcat res "(" scheme ")://"))))
|
||||
(if rest
|
||||
(setf res (strcat res "(" scheme ")|"))
|
||||
(setf res (strcat res "(" scheme ")://"))))
|
||||
(strcat "(" res ")"))))
|
||||
(a:when-let* ((all-uris (lines->uri text))
|
||||
(re (strcat (build-re-scheme) "\\P{White_Space}+"))
|
||||
(scanner (cl-ppcre:create-scanner re)))
|
||||
(scanner (cl-ppcre:create-scanner re)))
|
||||
(let ((results '()))
|
||||
(loop for uri in all-uris when (cl-ppcre:scan scanner uri) do
|
||||
(pushnew uri results :test #'string=))
|
||||
|
|
|
@ -2304,11 +2304,11 @@ there."
|
|||
choices)))
|
||||
(find-poll-id ()
|
||||
(when-let* ((fields (line-oriented-window:selected-row-fields *thread-window*))
|
||||
(status-id (db:row-message-status-id fields))
|
||||
(reblogged-status-id (db:row-message-reblog-id fields))
|
||||
(poll (or (db:find-poll-bound-to-status status-id)
|
||||
(db:find-poll-bound-to-status reblogged-status-id))))
|
||||
(db:row-id poll)))
|
||||
(status-id (db:row-message-status-id fields)))
|
||||
(let* ((reblogged-status-id (db:row-message-reblog-id fields))
|
||||
(poll (or (db:find-poll-bound-to-status status-id)
|
||||
(db:find-poll-bound-to-status reblogged-status-id))))
|
||||
(db:row-id poll))))
|
||||
(on-input-complete (choices)
|
||||
(let ((choices-list (split-words choices)))
|
||||
(if (or (null choices-list)
|
||||
|
|
Loading…
Reference in New Issue