mirror of https://codeberg.org/cage/tinmop/
- fixed adjusting strategy functions when drawing gemini text.
This commit is contained in:
parent
c924e8f636
commit
9568b88e8d
|
@ -229,22 +229,18 @@
|
|||
(when (rows window)
|
||||
(select-first-row window)))
|
||||
|
||||
(defun adjust-rows-noop (window)
|
||||
window)
|
||||
|
||||
(defun adjust-rows-select-last (window)
|
||||
(with-accessors ((rows rows)) window
|
||||
(when rows
|
||||
(let ((height (win-height-no-border window)))
|
||||
(when (not (< (rows-length window) height))
|
||||
(when (>= (rows-length window) height)
|
||||
(select-row window (- (rows-length window)
|
||||
height))))))
|
||||
window)
|
||||
|
||||
(defmethod adjust-selected-rows ((object row-oriented-widget) (strategy function))
|
||||
(with-accessors ((row-selected-index row-selected-index)) object
|
||||
(when (< row-selected-index
|
||||
(rows-length object))
|
||||
(funcall strategy object)))
|
||||
object)
|
||||
|
||||
(defmethod selected-row ((object row-oriented-widget))
|
||||
"Return the current selected row"
|
||||
(with-accessors ((rows rows)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
:initarg :metadata
|
||||
:accessor metadata)
|
||||
(adjust-rows-strategy
|
||||
:initform #'adjust-rows-select-first
|
||||
:initform #'adjust-rows-noop
|
||||
:initarg :adjust-rows-strategy
|
||||
:accessor adjust-rows-strategy)
|
||||
(text-starting-column
|
||||
|
|
|
@ -1935,6 +1935,7 @@
|
|||
:unselect-all
|
||||
:select-row
|
||||
:select-first-row
|
||||
:adjust-rows-noop
|
||||
:adjust-rows-select-first
|
||||
:adjust-rows-select-last
|
||||
:adjust-selected-rows
|
||||
|
@ -2074,7 +2075,6 @@
|
|||
:row-get-original-object
|
||||
:viewport-width
|
||||
:draw-downloading-animation
|
||||
:adjust-selected-rows
|
||||
:visible-rows
|
||||
:row-vertical-space-p
|
||||
:row-preformatted-p
|
||||
|
|
|
@ -1224,12 +1224,13 @@
|
|||
(progn
|
||||
(line-oriented-window:append-new-rows win new-rows)
|
||||
(gemini-viewer:append-metadata-link window-metadata links)
|
||||
(gemini-viewer:append-metadata-source window-metadata source))
|
||||
(gemini-viewer:append-metadata-source window-metadata source)
|
||||
(funcall (message-window:adjust-rows-strategy win) win))
|
||||
|
||||
(progn
|
||||
(setf (gemini-viewer:gemini-metadata-source-file window-metadata) source)
|
||||
(setf (gemini-viewer:gemini-metadata-links window-metadata) links)
|
||||
(funcall (message-window:adjust-rows-strategy win)
|
||||
win)
|
||||
(funcall (message-window:adjust-rows-strategy win) win)
|
||||
(line-oriented-window:update-all-rows win new-rows)))))))
|
||||
|
||||
(defmethod process-event ((object gemini-got-line-event))
|
||||
|
@ -1251,14 +1252,9 @@
|
|||
(not (skip-rendering-p object))
|
||||
(message-window:display-gemini-text-p win))
|
||||
(refresh-gemini-message-window links source ir-line append-text)
|
||||
(multiple-value-bind (x start length)
|
||||
(message-window:visible-rows win)
|
||||
(declare (ignore x))
|
||||
(if (or (not append-text)
|
||||
(< (+ start length)
|
||||
(windows:win-height-no-border win)))
|
||||
(windows:draw win)
|
||||
(message-window:draw-downloading-animation win))))))))
|
||||
(windows:draw win)
|
||||
(when append-text
|
||||
(message-window:draw-downloading-animation win)))))))
|
||||
|
||||
(defclass gemini-abort-downloading-event (program-event) ())
|
||||
|
||||
|
|
Loading…
Reference in New Issue