Skip to content

Commit

Permalink
Tweak info text display for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
j-bresson committed Aug 22, 2021
1 parent 92c1a29 commit 19bf0cd
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/visual-language/patch/patch-editor.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ The function and class reference accessible from the \"Help\" menu, or the \"Cla
(setf (object self) object)
(om-remove-all-subviews self)

(let* ((def-w 200)
(let* ((def-w 260)
(text-font (om-def-font :font1))
(title-font (om-def-font :font2b))
(inspector-layout
Expand All @@ -1689,7 +1689,7 @@ The function and class reference accessible from the \"Help\" menu, or the \"Cla
:subviews
(append
(cons
(om-make-di 'om-simple-text :size (om-make-point nil 20)
(om-make-di 'om-simple-text :size (om-make-point def-w 20)
:fg-color (om-def-color :dark-gray)
:text (object-name-in-inspector object)
:focus t ;; prevents focus on other items :)
Expand Down Expand Up @@ -1737,10 +1737,17 @@ The function and class reference accessible from the \"Help\" menu, or the \"Cla
(when (get-documentation object)
(list
:separator
(let* ((doc (get-documentation object)))
(let* ((doc (get-documentation object))
(line-h (cadr (multiple-value-list (om-string-size "ABC" text-font))))
(wrap-text (om-string-wrap doc (- def-w 10) text-font))
(cut-text (if (> (length wrap-text) 10)
(append (first-n wrap-text 9) '("..."))
wrap-text))
(n-lines (length cut-text)))
(om-make-di 'om-multi-text
:size (om-make-point nil nil)
:text (format nil "~%~A~%~%" doc)
:size #+windows (omp nil (* line-h (1+ n-lines))) #-windows (omp nil nil)
:text #+windows cut-text #-windows (format nil "~%~A~%~%" doc)
;:text (format nil "~%~A~%~%" doc)
:fg-color (om-def-color :dark-gray)
:font text-font)
)))
Expand All @@ -1752,7 +1759,7 @@ The function and class reference accessible from the \"Help\" menu, or the \"Cla
:subviews
(list
(let* ((doc (default-editor-help-text (editor self)))
(line-h (cadr (multiple-value-list (om-string-size "abc" text-font))))
(line-h (cadr (multiple-value-list (om-string-size "ABC" text-font))))
(n-lines (length (om-string-wrap doc def-w text-font))))
(om-make-di 'om-multi-text
:size (om-make-point def-w (* line-h (+ 2 n-lines)))
Expand Down

0 comments on commit 19bf0cd

Please sign in to comment.