View Full Version : Panel in a Menu

27 Sep 2011, 3:32 AM
I hav a panel in a menu which is attached to a button, so that the panel is displayed when clicking on the button. The panel inside the menu is resizable by the user. After the user has resized the panel, and closed the menu, the menu has the size the user specified, but the panel doesn't take the entire space (vertically). Is it OK to have a resizable panel inside a menu, or is this approach invalid? How can I force the panel to fit the menu area when displaying? Calling doLayout() on the menu doesn't seem to have any effect.

29 Sep 2011, 10:36 AM
I don't see the point of having a resizable menu, but then again - i don't know the full use case.

Internally, the menu uses the vbox layout, so you might be able to set flex: 1 on the panel and see if it uses all of the available space.

4 Oct 2011, 7:47 AM
The point was to attach the panel to the button and make it stick to the button when resizing the page. Something like the windows start menu. Is there a better way to achieve this? Setting flex to 1 restricts the panel's resizing to horizontal.

2 Dec 2011, 1:57 AM
We worked around this issue by using a window that is aligned to the button. We simulated the behavior of the button, so it is pressed as long as the window is opened.

But you can still tell the difference between this and a normal menu, because a normal menu is closed when a other menu in the same toolbar is opened. There wasn't enough time to simulate this too.