Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve menu appearance #78

Closed
wants to merge 2 commits into from
Closed

Conversation

Vogtinator
Copy link
Member

@Vogtinator Vogtinator commented Mar 11, 2021

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 "":
Screenshot_20210311_163552

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 "":
Screenshot_20210311_163552

By specifying the dialog height as items+5, the empty lines disappear:

dialog --menu "Choose wisely" 7 0 0 Value1 "" Value2 ""
Screenshot_20210311_163848

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:
dialog --menu "Choose wisely" 20 0 30 $(seq 1 100)
Screenshot_20210311_164410

The behaviour gets really weird in that case though, because
dialog --menu "Choose wisely" 7 0 0 Value1 "" Value2 "" and dialog --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.

For consistency. Otherwise the product title disappears sometimes.
Currently it always passes the maximum number of menu items which fit on
the screen, which isn't ideal if there are fewer items to display. To avoid
wasting space, never return more than the number of items.
@Vogtinator
Copy link
Member Author

Vogtinator commented Apr 8, 2021

Apparently the bug with the empty lines at the bottom got fixed in dialog recently!

https://openqa.opensuse.org/tests/1692837#step/firstrun/5

So we just need https://bugzilla.opensuse.org/show_bug.cgi?id=1184503 fixed and then it should look nice everywhere

@Vogtinator
Copy link
Member Author

Got applied as part of #79

@Vogtinator Vogtinator closed this May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant