mirror of https://codeberg.org/cage/tinmop/
- [GUI] - added flag to interrupt discard rendering of gemtext.
For example is used before scaling the text the rendering is blocked, the gemtext widget cleaned before starting again the rendering with scaled fonts. - [GUI] fixed code to revive a stream.
This commit is contained in:
parent
8730bbd192
commit
45ff0cc7c4
|
@ -725,6 +725,7 @@ local file paths."
|
|||
with current-pre-block-alt-text = nil
|
||||
for rendered-line across (subseq ir-rendered-lines starting-index)
|
||||
for ir-line across (subseq ir-lines starting-index)
|
||||
until (interrupt-rendering-p main-window)
|
||||
do
|
||||
(let ((type (ir-type ir-line)))
|
||||
(ecase (format-keyword type)
|
||||
|
@ -1353,7 +1354,14 @@ local file paths."
|
|||
(ir-lines
|
||||
:initform (misc:make-fresh-array 0)
|
||||
:initarg :ir-lines
|
||||
:accessor ir-lines)))
|
||||
:accessor ir-lines)
|
||||
(interrupt-rendering-lock
|
||||
:initform (bt:make-lock "render-lock")
|
||||
:initarg :interrupt-rendering-lock
|
||||
:accessor interrupt-rendering-lock)
|
||||
(interrupt-rendering
|
||||
:initform nil
|
||||
:initarg :interrupt-rendering)))
|
||||
|
||||
(defmethod initialize-instance :after ((object main-frame) &key &allow-other-keys)
|
||||
(with-accessors ((main-window main-window)
|
||||
|
@ -1414,6 +1422,12 @@ local file paths."
|
|||
(gui:focus (nodgui.mw:autocomplete-entry-widget (iri-entry (tool-bar object))))
|
||||
object))
|
||||
|
||||
(defgeneric interrupt-rendering-p (object))
|
||||
|
||||
(defgeneric interrupt-rendering (object))
|
||||
|
||||
(defgeneric restart-rendering (object))
|
||||
|
||||
(defgeneric toc-char-width (object))
|
||||
|
||||
(defgeneric toc-clear (object))
|
||||
|
@ -1427,6 +1441,20 @@ local file paths."
|
|||
|
||||
(defgeneric fit-toc-char-width (object new-width))
|
||||
|
||||
(defmethod interrupt-rendering-p ((object main-frame))
|
||||
(misc:with-lock ((interrupt-rendering-lock object))
|
||||
(slot-value object 'interrupt-rendering)))
|
||||
|
||||
(defun set-interrupt-rendering-state (main-frame value)
|
||||
(misc:with-lock ((interrupt-rendering-lock main-frame))
|
||||
(setf (slot-value main-frame 'interrupt-rendering) value)))
|
||||
|
||||
(defmethod interrupt-rendering ((object main-frame))
|
||||
(set-interrupt-rendering-state object t))
|
||||
|
||||
(defmethod restart-rendering ((object main-frame))
|
||||
(set-interrupt-rendering-state object nil))
|
||||
|
||||
(defmethod fit-toc-char-width ((object main-frame) new-width)
|
||||
(with-accessors ((toc-frame toc-frame)
|
||||
(gemini-paned-frame gemini-paned-frame)) object
|
||||
|
@ -1484,7 +1512,9 @@ local file paths."
|
|||
(trim-blanks (gui:text (iri-entry (tool-bar main-window)))))
|
||||
|
||||
(defun scale-gemtext (main-window offset)
|
||||
(interrupt-rendering main-window)
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(restart-rendering main-window)
|
||||
(clear-gemtext main-window)
|
||||
(setf (gemtext-font-scaling main-window)
|
||||
(if offset
|
||||
|
|
|
@ -86,10 +86,9 @@
|
|||
(selection (first selections)))
|
||||
(let* ((url (gui:id selection))
|
||||
(new-rows (all-rows)))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(client-main-window:set-address-bar-text gui-goodies:*main-frame* url)
|
||||
(client-main-window::open-iri url gui-goodies:*main-frame* t)
|
||||
(resync-rows stream-table new-rows)))))))
|
||||
(client-main-window:set-address-bar-text gui-goodies:*main-frame* url)
|
||||
(client-main-window::open-iri url gui-goodies:*main-frame* t)
|
||||
(resync-rows stream-table new-rows))))))
|
||||
|
||||
(defun init-frame (parent-frame)
|
||||
(let* ((wrapper-frame (make-instance 'stream-frame :master parent-frame))
|
||||
|
|
Loading…
Reference in New Issue