From 8338d414b361e4fb961221642c1064e9dc89ba65 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 6 Nov 2020 10:59:54 +0100 Subject: installer: Limit listbox height. Fixes: . * gnu/installer/newt.scm (init): Print screen size. * gnu/installer/newt/page.scm (default-listbox-height): New variable. (run-listbox-selection-page): Use it. * gnu/installer/newt/wifi.scm (wifi-listbox-height): Ditto. * gnu/installer/newt/network.scm (run-technology-page): Set the maximum listbox height to 5. * gnu/installer/newt/ethernet.scm (run-ethernet-page): Ditto. * gnu/installer/newt/final.scm (run-config-display-page): Change listbox height. * gnu/installer/newt/partition.scm (run-disk-page): Ditto. * gnu/installer/newt/welcome.scm (display-logo?): New procedure. (run-menu-page): Use it. * gnu/installer/steps.scm (%configuration-file-width): Remove it. --- gnu/installer/newt/page.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gnu/installer/newt/page.scm') diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index 1d6b9979b4..4209674c28 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -32,7 +32,9 @@ (define-module (gnu installer newt page) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:use-module (newt) - #:export (draw-info-page + #:export (default-listbox-height + + draw-info-page draw-connecting-page run-input-page run-error-page @@ -168,6 +170,10 @@ (define title (_ (values reason argument)))))) +(define (default-listbox-height) + "Return the default listbox height." + (max 5 (- (screen-rows) 20))) + (define (draw-info-page text title) "Draw an informative page with the given TEXT as content. Set the title of this page to TITLE." @@ -339,7 +345,8 @@ (define* (run-listbox-selection-page #:key (info-textbox-width 50) listbox-items listbox-item->text - (listbox-height 20) + (listbox-height + (default-listbox-height)) (listbox-default-item #f) (listbox-allow-multiple? #f) (sort-listbox-items? #t) -- cgit v1.2.3