nanogui icon indicating copy to clipboard operation
nanogui copied to clipboard

Run performLayout() again when the combobox gets a new set of items

Open ermarch opened this issue 6 years ago • 3 comments

If the item-list of a combobox changes (multiple times) at run-time it is required to re-calculate the layout again otherwise the popup widget will be stale or empty. Unfortunately there is no way to request performLayout for a single widget so they will all be recalculated.

ermarch avatar May 31 '19 09:05 ermarch

I haven't tried it myself, but couldn't you do somewidget->performLayout(screen->nvgContext()), since all widgets have a performLayout method?

biglizards avatar Jun 19 '19 09:06 biglizards

Good idea, if it works I'll update the pull request.

Erik

ermarch avatar Jun 19 '19 09:06 ermarch

Unfortunately this doesn't seem to work as expected.

Mainly because the number of items in the list stays fixed. So updating with a different number of items causes a problem.

I'm afraid this might lead to a cascading number of fixes in the PerformLayout functions to get it fixed properly.

Erik

ermarch avatar Jun 19 '19 10:06 ermarch