Bugzilla – Bug 1219177
YaST Edit Printer dialogue misaligned UI element scaling
Last modified: 2024-01-25 13:05:40 UTC
Created attachment 872185 [details] Edit Printer dialog with lots of whitespace between the listboxes. The Edit Printer window (and related dialogues) in YaST exhibit strange resizing behaviour when the window is resized vertically. The upper and center list boxes resize with a percentage of the overall window, but the scale factors do not add to 100%. As a result, when you resize the window vertically, unused whitespace appears between the listboxes (see screenshots). As a side effect, when you have different printed installed, the listbox with the list of drivers can get quite crowded, because it does not make use of the available space in the window. How to reproduce: 1. Go to YaST (GUI version) → Printers, select a printer, click Edit 2. Resize the edit window vertically. Observed behaviour: The listboxes resize vertically, but less so than the window. Empty space appears between the listboxes and other UI elements. Expected behaviour: The listboxes should resize to fill the available whitespace.
Created attachment 872186 [details] Edit Printer dialog with a bit less whitespace between the listboxes, showing scaling behaviour.
Created attachment 872187 [details] Ncurses Edit Printer window with lots of whitespace The ncurses version has the same issue
This looks like the layout using stretchable VSpacings where they really should not be stretchable, but let the widgets with contents (like those tables) receive any extra space.
Created attachment 872190 [details] Screenshot showing the VStretch Using Ctrl-Shift-Alt-Y to open the YWidgetSpy, you can instpect the widget hierarchy and modify widget properties. You can see here that it uses a VStretch placeholder which (as the name implies) is vertically stretchable, so it eats the extra space; it is distributed between the content widget (the table) and that VStretch, so each of them gets the same proportion of extra space if there is any. Simply replace this VStretch with a VSpacing(1) or a VSpacing(2) to get some empty space, but not that much.
Created attachment 872191 [details] Screenshot showing the other VStretch And it's the same with the other VStretch.
Created attachment 872192 [details] Screenshot: Both non-stretchable Setting the vstrechable property of both to 'false' gets rid of that grey space, but now there is no border between the widgets which looks wrong. Simply use a VSpacing(1) or VSpacing(2) instead. A VSpacing is not vertically stretchable by default. This is explained in great detail at the libyui layout how-to documentation, but in this case just using VSpacing instead of VStretch will do the trick.
-> yast2-printer maintainer Johannes Meixner
The YaST libyui layout how-to documentation: https://doc.opensuse.org/projects/YaST/openSUSE11.3/tdg/bk08ch01.html#layout-howto