Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consistent appearance and less empty space inside the dialog.
While
dialog --menu
allows to specify the total dialog width, height and menu item count, I was unable to find a way to get the dialog box just small enough to contain the description and menu items. There are always two empty lines below the menu list, unless we really compute dialog and menu height dynamically everywhere, which might get complex with translations and various terminal sizes...Everything automatic results in empty lines and will overflow the backtitle if there are too many items:
dialog --menu "Choose wisely" 0 0 0 Value1 "" Value2 ""
:The overflowing can be avoided by setting the menu height explicitly, which is what this PR does, but the empty lines remain:
dialog --menu "Choose wisely" 0 0 2 Value1 "" Value2 ""
:By specifying the dialog height as items+5, the empty lines disappear:
dialog --menu "Choose wisely" 7 0 0 Value1 "" Value2 ""
For some reason the dialog height is ignored when there are more items than can fit - it fills the entire screen anyway!
dialog --menu "Choose wisely" 20 0 0 $(seq 1 100)
(screenshot omitted)
However, by specifying the menu item height explicitly as well, it's suddenly honoured again, even if the menu height is too big to fit:
![Screenshot_20210311_164410](https://user-images.githubusercontent.com/1622084/110813672-0327c300-8289-11eb-8614-8c3a9b841e98.png)
dialog --menu "Choose wisely" 20 0 30 $(seq 1 100)
The behaviour gets really weird in that case though, because
dialog --menu "Choose wisely" 7 0 0 Value1 "" Value2 ""
anddialog --menu "Choose wisely" 7 0 2 Value1 "" Value2 ""
behave differently, even though they shouldn't. I assume this is because of the two empty lines at the bottom.Any idea?
Marked as draft because I didn't check it inside jeos-firstboot yet, only outside.