From ec26a12151b90e254ce69c4f1fff54263486c673 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sun, 30 May 2021 20:55:25 +0200 Subject: [PATCH] Added dynamic dialog sizes --- configure | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/configure b/configure index bad5858..dd4c489 100755 --- a/configure +++ b/configure @@ -670,14 +670,34 @@ function menu() { fi } -SELECTED_MENU_ITEM="" -MENU_SIZE=("20" "76" "12") -INPUTBOX_SIZE=("11" "76") -EDITTEXT_SIZE=("16" "76") -RADIOLIST_SIZE=("20" "76" "8") -BUILDLIST_SIZE=("20" "76" "8") -HELP_POPUP_SIZE=("8" "66") -CONFIRM_SIZE=("8" "66") +function init_menu_size() { + local cols + local rows + cols=$(tput cols) || cols=80 + rows=$(tput lines) || rows=24 + + local max_h=$((rows - 3)) + local max_w=$((cols - 6)) + + SELECTED_MENU_ITEM="" + MENU_SIZE=("$max_h" "$max_w" "$((max_h - 8))") + INPUTBOX_SIZE=("11" "$max_w") + EDITTEXT_SIZE=("$max_h" "$max_w") + RADIOLIST_SIZE=("$max_h" "$max_w" "$((max_h - 12))") + BUILDLIST_SIZE=("$max_h" "$max_w" "$((max_h - 12))") + HELP_POPUP_SIZE=("$((max_h - 12))" "$((max_w - 10))") + CONFIRM_SIZE=("8" "66") +} + +#SELECTED_MENU_ITEM="" +#MENU_SIZE=("20" "76" "12") +#INPUTBOX_SIZE=("11" "76") +#EDITTEXT_SIZE=("16" "76") +#RADIOLIST_SIZE=("20" "76" "8") +#BUILDLIST_SIZE=("20" "76" "8") +#HELP_POPUP_SIZE=("8" "66") +#CONFIRM_SIZE=("8" "66") +init_menu_size ################################################ @@ -812,7 +832,7 @@ function PARTITIONING_ROOT_FS_menu() { function PARTITIONING_USE_LUKS_tag() { echo " ├ Use LUKS"; } function PARTITIONING_USE_LUKS_label() { on_off_label "$PARTITIONING_USE_LUKS" " ├ "; } function PARTITIONING_USE_LUKS_show() { [[ $PARTITIONING_SCHEME != "custom" ]] && one_of "$PARTITIONING_SCHEME" "classic_single_disk" "btrfs_centric"; } -function PARTITIONING_USE_LUKS_help() { echo "Determines if LUKS will be used to encrypt your root partition."; } +function PARTITIONING_USE_LUKS_help() { echo "Determines if LUKS will be used to encrypt your root partition. Export the desired encryption key via export GENTOO_INSTALL_ENCRYPTION_KEY="..." before installing."; } function PARTITIONING_USE_LUKS_menu() { on_off_toggle "PARTITIONING_USE_LUKS" UNSAVED_CHANGES=true @@ -821,7 +841,7 @@ function PARTITIONING_USE_LUKS_menu() { function PARTITIONING_ZFS_ENCRYPTION_tag() { echo " ├ ZFS Encryption"; } function PARTITIONING_ZFS_ENCRYPTION_label() { on_off_label "$PARTITIONING_ZFS_ENCRYPTION" " ├ "; } function PARTITIONING_ZFS_ENCRYPTION_show() { [[ $PARTITIONING_SCHEME != "custom" ]] && one_of "$PARTITIONING_SCHEME" "zfs_centric" && one_of "$PARTITIONING_ZFS_POOL_TYPE" "standard"; } -function PARTITIONING_ZFS_ENCRYPTION_help() { echo "Determines if ZFS encryption will be used to encrypt your root partition."; } +function PARTITIONING_ZFS_ENCRYPTION_help() { echo "Determines if ZFS encryption will be used to encrypt your root partition. Export the desired encryption key via export GENTOO_INSTALL_ENCRYPTION_KEY="..." before installing."; } function PARTITIONING_ZFS_ENCRYPTION_menu() { on_off_toggle "PARTITIONING_ZFS_ENCRYPTION" UNSAVED_CHANGES=true