I have a pick list which contains some long options. The pick list, when closed, needs to be less wide than the widest option in order to fit nicely in my GUI. When the pick list is opened, I would like the menu overlay to be wide enough to display the widest option.
When I set the width of the pick list to Length::Shrink, the closed state is as wide as the widest option
When I force the width of the pick list to be less wide using Length::Fixed(x), the menu overlay is also fixed at that narrower width, and hence I can’t fully read the longest option
I have considered changing the the width dynamically by using the on_open and on_close messages, but that disrupts the layout of adjacent widgets, and also results in issues with the Z-order of adjacent widgets.
I can’t see that it is exposed in the API, but would it be valid, for example, so expose another method on the PickList along the lines of PickList::menu_width.
One could then set the PickList::width to Length::Fixed(x), but separately set the menu overlay width to Length::Shrink.
How does that sound?