From b0ede26bff9acf36b4361ef232e79976cd4686ea Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 12 May 2026 14:04:51 +0000 Subject: [PATCH] fix: demo uses backend-size instead of hardcoded 80x24 --- demo.lisp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/demo.lisp b/demo.lisp index 148f502..4b5f582 100644 --- a/demo.lisp +++ b/demo.lisp @@ -125,8 +125,12 @@ ./demo.sh shell wrapper." (init-app-state) (let* ((backend (detect-backend)) - (w 80) (h 24)) - (declare (ignore h)) + (w (multiple-value-bind (cols rows) (backend-size backend) + (declare (ignore rows)) + cols)) + (h (multiple-value-bind (cols rows) (backend-size backend) + (declare (ignore cols)) + rows))) (initialize-backend backend) (unwind-protect (loop while (getf *app* :running) @@ -146,19 +150,19 @@ (draw-text backend x-pos 4 label :text-muted nil)))) ;; Content area (case (getf *app* :tab) - (0 (render-tab-home backend 4 6 72 20)) - (1 (render-tab-widgets backend 4 6 72 24 + (0 (render-tab-home backend 4 6 (- w 4) (- h 8))) + (1 (render-tab-widgets backend 4 6 (- w 4) (- h 8) (getf *app* :input) (getf *app* :textarea))) - (2 (render-tab-console backend 4 6 72 16))) + (2 (render-tab-console backend 4 6 (- w 4) (- h 8)))) ;; Mouse cursor indicator (let ((mx (getf *app* :mouse-x)) (my (getf *app* :mouse-y))) (when (and (>= mx 0) (>= my 0)) (draw-text backend mx my "@" :bright-cyan nil))) ;; Status bar - (draw-rect backend 2 23 (- w 4) 1 :bg :blue) - (draw-text backend 4 23 + (draw-rect backend 2 (- h 2) (- w 4) 1 :bg :blue) + (draw-text backend 4 (- h 2) (format nil " Tab ~d/3 | ~d events " (1+ (getf *app* :tab)) (length *log*)) :bright-white :blue :bold t)