Skip to content

Commit a07f1e3

Browse files
committed
make the window shrink back down when the font size is lowered; also, add a close button to the dialog
closes #599
1 parent d702a8a commit a07f1e3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drracket/drracket/private/insert-large-letters.rkt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
(: make-large-letters-dialog (String Char (Option (Instance Frame%)) -> (Option String)))
6767
(define (make-large-letters-dialog comment-prefix comment-character parent)
6868
(define dlg (new (frame:focus-table-mixin dialog%)
69-
[parent parent]
69+
[parent parent]
70+
[style '(close-button)]
7071
[width 700]
7172
[label (string-constant large-semicolon-letters)]))
7273
(define: text-field : (Instance Text-Field%)
@@ -147,15 +148,18 @@
147148
(λ (x y) (send dlg show #f))))
148149
(: update-txt (String -> Any))
149150
(define (update-txt str)
151+
(send dlg begin-container-sequence)
150152
(send txt begin-edit-sequence)
151153
(send txt lock #f)
152154
(send txt delete 0 (send txt last-position))
153155
(let ([bm (render-large-letters comment-prefix comment-character (get-chosen-font) str txt #t)])
154156
(send ec set-line-count (+ 1 (send txt last-paragraph)))
157+
(send dlg resize 0 0)
155158
(send txt lock #t)
156159
(send txt end-edit-sequence)
157160
(send count set-label (format columns-string (get-max-line-width txt)))
158-
(send dark-msg set-bm (if (equal? str "") #f bm))))
161+
(send dark-msg set-bm (if (equal? str "") #f bm)))
162+
(send dlg end-container-sequence))
159163

160164

161165
(let ()

0 commit comments

Comments
 (0)