1
0
Fork 0

- [GUI] fixed TOC's item number padding.

This commit is contained in:
cage 2023-06-24 18:16:12 +02:00
parent a5df3cbeae
commit b9ee04c1e3
1 changed files with 4 additions and 2 deletions

View File

@ -441,7 +441,9 @@
#'extract-level #'extract-level
#'extract-gid #'extract-gid
#'extract-header-text)) #'extract-header-text))
(toc-text (mapcar (lambda (a) (getf a :header)) toc)) (toc-text (mapcar (lambda (a)
(trim-blanks (getf a :header)))
toc))
(longest-text (find-longest-string toc-text)) (longest-text (find-longest-string toc-text))
(max-text-length (length longest-text)) (max-text-length (length longest-text))
(toc-numbers (mapcar (lambda (a) (toc-numbers (mapcar (lambda (a)
@ -452,7 +454,7 @@
(join-with-strings numbers-as-text "."))) (join-with-strings numbers-as-text ".")))
toc)) toc))
(longest-number (find-longest-string toc-numbers)) (longest-number (find-longest-string toc-numbers))
(max-number-length (length longest-number)) (max-number-length (1+ (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 (toc-entries-text
(loop for text in toc-text (loop for text in toc-text