Added dynamic dialog sizes

This commit is contained in:
oddlama 2021-05-30 20:55:25 +02:00
parent 91dfff58c1
commit ec26a12151
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
1 changed files with 30 additions and 10 deletions

36
configure vendored
View File

@ -670,14 +670,34 @@ function menu() {
fi fi
} }
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="" SELECTED_MENU_ITEM=""
MENU_SIZE=("20" "76" "12") MENU_SIZE=("$max_h" "$max_w" "$((max_h - 8))")
INPUTBOX_SIZE=("11" "76") INPUTBOX_SIZE=("11" "$max_w")
EDITTEXT_SIZE=("16" "76") EDITTEXT_SIZE=("$max_h" "$max_w")
RADIOLIST_SIZE=("20" "76" "8") RADIOLIST_SIZE=("$max_h" "$max_w" "$((max_h - 12))")
BUILDLIST_SIZE=("20" "76" "8") BUILDLIST_SIZE=("$max_h" "$max_w" "$((max_h - 12))")
HELP_POPUP_SIZE=("8" "66") HELP_POPUP_SIZE=("$((max_h - 12))" "$((max_w - 10))")
CONFIRM_SIZE=("8" "66") 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_tag() { echo " ├ Use LUKS"; }
function PARTITIONING_USE_LUKS_label() { on_off_label "$PARTITIONING_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_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() { function PARTITIONING_USE_LUKS_menu() {
on_off_toggle "PARTITIONING_USE_LUKS" on_off_toggle "PARTITIONING_USE_LUKS"
UNSAVED_CHANGES=true UNSAVED_CHANGES=true
@ -821,7 +841,7 @@ function PARTITIONING_USE_LUKS_menu() {
function PARTITIONING_ZFS_ENCRYPTION_tag() { echo " ├ ZFS Encryption"; } function PARTITIONING_ZFS_ENCRYPTION_tag() { echo " ├ ZFS Encryption"; }
function PARTITIONING_ZFS_ENCRYPTION_label() { on_off_label "$PARTITIONING_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_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() { function PARTITIONING_ZFS_ENCRYPTION_menu() {
on_off_toggle "PARTITIONING_ZFS_ENCRYPTION" on_off_toggle "PARTITIONING_ZFS_ENCRYPTION"
UNSAVED_CHANGES=true UNSAVED_CHANGES=true