summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-03-26 09:54:29 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-03-26 09:54:29 -0400
commit5941a2379dbcaa22f1da3f33dbcf38662727d164 (patch)
tree27f9cc00eeff00d556e8944e763ad50a7ab56808
parentd143ac25a36cc684dcab713a126aa1ed82014eb0 (diff)
Auto-resize minibuffer background.
-rw-r--r--catbird/minibuffer.scm16
1 files changed, 9 insertions, 7 deletions
diff --git a/catbird/minibuffer.scm b/catbird/minibuffer.scm
index 756b247..197b695 100644
--- a/catbird/minibuffer.scm
+++ b/catbird/minibuffer.scm
@@ -70,13 +70,15 @@
#:prompt %prompt)))
(define-method (resize-minibuffer (minibuffer <minibuffer>) width)
- (set! (painter (& minibuffer background))
- (with-style ((fill-color %background-color))
- (fill
- (rectangle (vec2 0.0 0.0)
- width
- (+ (font-line-height (font (& minibuffer editor)))
- (* %padding 2.0)))))))
+ (let ((bg (& minibuffer background)))
+ (set! (painter bg)
+ (with-style ((fill-color %background-color))
+ (fill
+ (rectangle (vec2 0.0 0.0)
+ width
+ (+ (font-line-height (font (& minibuffer editor)))
+ (* %padding 2.0))))))
+ (resize bg)))
(define-method (clear-minibuffer (minibuffer <minibuffer>))
(clear-line (& minibuffer editor)))