Skip to content

kcm/DeviceListItem: Set width for comboboxes, with correctly sized popup

Oliver Beard requested to merge (removed):device-combobox into master

This MR changes the DeviceListItem delegate, such that the comboboxes have a fixed size. I wanted this in my original layout changes for the KCM, but it was necessary to allow them to grow such that the full device names would appear in the popup.

This can cause the layout to break:

image

This MR preserves that by ensuring that the popup width is large enough to accommodate the full device name, and is positioned to avoid going off of the page.

image


Currently marked as draft with debugging comments left in. A comment explaining the popup.onOpened {} will also be added, e.g. // Ensure the popup is wide enough for full device names and positioned inside the page. The new code could also be moved to DeviceComboBox.

TODO: Test RTL behaviour is as expected. Works!

Thanks to @iasensio for the code segment for setting the popup width, and @ndavis for a cleaner implementation.

Edited by Oliver Beard

Merge request reports