Word wrap the edit window using :wrap-lines in a 'styled-pane'

This commit is contained in:
Robert C. Martin 2022-06-16 15:12:59 -05:00
parent b171c52458
commit 89868f3d0d
3 changed files with 7 additions and 8 deletions

View File

@ -189,3 +189,4 @@ the proposition that all men are created equal."
event {:content content :tags [[:p "deadbeef"]]}]
(should= "#[1]" (replace-references event))))))

View File

@ -86,11 +86,7 @@
(let [tag (first tags)]
(if (= (first tag) :subject)
(abbreviate (second tag) 90)
(recur (rest tags))
))
)
)
(recur (rest tags))))))
(declare lookup-reference)
@ -118,4 +114,3 @@
(str "id:" (abbreviate id-string 8))
name)]
(str "@" name)))))

View File

@ -5,6 +5,8 @@
[more-speech.ui.swing.ui-context :refer :all])
(:use [seesaw core]))
(declare format-content)
(defn make-edit-window [kind]
(let [reply? (= kind :reply)
event-context (:event-context @ui-context)
@ -16,7 +18,8 @@
edit-frame (frame :title (name kind)
:size [1000 :by 500]
:on-close :dispose)
edit-area (editor-pane :font config/default-font)
edit-area (styled-text :font config/default-font
:wrap-lines? true)
send-button (button :text "Send")
event-map (:text-event-map event-state)
selected-id (if reply? (:selected-event @event-context) nil)
@ -40,4 +43,4 @@
:north subject-panel
:center (scrollable edit-area)
:south (flow-panel :items [send-button])))
(show! edit-frame)))
(show! edit-frame)))