1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-01-22 03:25:41 +01:00

- [GUI] improved formatting of TOC entries.

This commit is contained in:
cage 2023-05-20 20:02:11 +02:00
parent 95e9e2a9c3
commit 14525c2f1b

View File

@ -453,18 +453,15 @@
(longest-number (find-longest-string toc-numbers)) (longest-number (find-longest-string toc-numbers))
(max-number-length (length longest-number)) (max-number-length (length longest-number))
(max-non-padded-text-size (+ max-text-length max-number-length)) (max-non-padded-text-size (+ max-text-length max-number-length))
(toc-entries-text (loop for text in toc-text (toc-entries-text
(loop for text in toc-text
for number in toc-numbers for number in toc-numbers
collect collect
(let* ((text-length (+ (length text) (let* ((prefix (right-padding number
(length number))) max-number-length
(padding-size (- max-non-padded-text-size :padding-char
text-length)) (swconf:gemini-toc-padding-char))))
(padding (make-string padding-size (strcat prefix text)))))
:initial-element (swconf:gemini-toc-padding-char))))
(strcat number
padding
text)))))
(values (values
(loop for toc-entry in toc (loop for toc-entry in toc
for text in toc-entries-text for text in toc-entries-text