qml: achieve a chrome-like menu - qt

I would like to achieve with QML a menu with a single menu item, like chrome does it. It has this button with those three horizontal bars and when you click it you get a single menu. Recent versions of firefox also follow the same principle. It allows not to waste too much horizontal space in the GUI of the application, unline usual menus which take up the whole width of the window.
I did not manage to reproduce exactly this GUI with QML. From what I saw you can either use a QML ApplicationWindow, and then a MenuBar, but then it takes the whole width of the window... Or have a toggle button to trigger the menu, then use a standalone Menu and its popup() method, but then it pops-up directly under the cursor, not exactly under the button to open the menu, which doesn't look good. That's really more abusing the mechanism for a context menu.
I could make a fake menu which would be a custom widget in my window but then it could not expand beyond my application window. Such a behaviour is almost required because I'll put this button on the far right of the window, as chrome does it.
Is it possible to achieve exactly that behaviour in pure QML (no C++)?

What I did for now is the last option that I mentioned: fake menu in the window. It's drawing using the canvas which enables me to make it a little pointy arrow from the menu to the menu toggle button, as done also by firefox.
The minus as I said is that the menu cannot go out of the window, plus everything is very manual (mouseover effect for menu items...), so I'm still interested in other solutions.
EDIT: ok after some time I realized a big plus of my approach: I can put custom widgets, not only labels in the menu. So I think it's absolutely the right approach now.

Related

JavaFX 2 - Autoscroll to last item in exceeded toolbar

I am creating File Manager like Miller column app for windows in JavaFX for learning purpose.
Check the screenshot below:
As you can see, when toolbar exceeds, there comes a double arrow button for more items to select from popup.
I already did auto scroll for miller column, which works as expected.
scrollPane.hvalueProperty().bind(hBox.widthProperty());
I would like to auto scroll toolbar to last item and show double arrow on left side.
I am adding adding clickable buttons in toolbar for traversing like manual BreadCumBar.
Tried ControlsFX BreadCumBar, it doesn't even show arrows or popup when exceeds, Bug here : https://bitbucket.org/controlsfx/controlsfx/issues/810/no-double-arrow-popup-like-when.
If its not possible to do so with toolbar, I would like to know how to customize toolbar popup only via css. Or any other way that improve usability easiness.
Also I would love to know suggestions for whole app from expert designers.
Thanks.

iPad SplitView Master View shows but with minor (and incorrect) variation

I'm practicing development of a simple iPad Split View app (Stanford's Hegarty online class). And everything works for the most part. However, the Master side ('left side), although working in landscape mode looks a little different than what I expect it to as a 'popover' in portrait mode. The 'popover' covers the left side of the screen including the toolbar button item that triggered it where normally it should not cover that button.
Unfortunately I can't post images so I'll try my best to describe in more detail. Normally the 'proper' popover will be hovering right below the bar item button that triggered it with a thick arrow-ish thingie (the 'anchor') pointing to the button and not covering that button. The popover can be dismissed by clicking on that button again (or elsewhere on the screen).
What's happening to me, however, is that when I click the bar item button to show the popover, the resulting popover 'covers' the button and essentially fills up the left portion of the screen (the detail view is under it and most of it is showing) with its designated width (so, again, it doesn't cover the entire detail view). The is no 'anchor' arrow pointing to the bar item button since it is obviously covering it instead. The popover is dismissed normally once I click anywhere else on the screen.
So why is my popover covering the button and not simply hovering under it with an 'anchor' pointing to it as it should?
I don't think it it makes much sense to post code at this point because I don't think it'll help and more importantly not sure what portion to post considering this might be a problem with how I wired it in the Builder. Any thoughts will be greatly appreciated!
Thanks!
Mo
I believe its a change that came in IOS5.1
If you want the same behaviour you probably need to set the master up as a popover segue, from a toolbar button or similar in the detail view, and set the split view delegate to not show the master in portrait.
I'm on the move now but if you want any more info let me know and I'll try and get back to you later.

Force MenuBar to always open downward

I have a MenuBar which opens downwards except when there isn't enough room to open it. For example, it may have 10 items but there's only enough room to display 4-5. Flex then tries to display the menu above the bar, which is completely off the screen. Is there some property or style I'm overlooking to always force it to open downward?
EDIT: Thought I'd give some clarification as to how I plan to circumvent the issue. If I can always force the menubar to be orientated downwards, I can make it into a scrollable menubar displaying only a few items at worst.
I do not have a direct answer. However, the best resource I have ever seen on the menuBar component is here.
http://adobestudionews.net/devnet/flash/articles/creating_as3_components_pt2.html
My guess is it is buried in the renderers.

Qt Tab widget that wraps its menu bar

When the menu of a QTabWidget grows beyond its width, the default behaviour is to turn the tab menu into a horizontaly scrollable list. What I'd prefer is to wrap the menu round so you now have two rows of tabs. This style is used on some Windows dialogs. I can't find any way to do this though.
Is anyone aware of a trick or option to allow this kind of layout?
This option is currently not available for QTabWidget. Perhaps you could simulate this behavior using a few QTabBars?
There is an outstanding request for this on Qt's bug tracker but no progress on it yet. Perhaps somebody knows of another component/solution.
Flow layout does what you need, but then you will have to also make your own "tab widget" http://doc.trolltech.com/4.7/layouts-flowlayout.html

Animated auto-hide ApplicationControlBar

Anyone know how to create animated auto-hide on ApplicationControlBar just like Windows's taskbar?
I'm totally new on this.
Thanks.
The issue with doing this is that on Windows, you have a 'lower bound'--also known as the bottom of the screen which is used to trigger the display of the task bar based on the mouse location.
In a browser based app, you don't have that spot which is easy for the user to roll their mouse over.
That said, if you're still adamant, you should be able to put something together easily using the mouse over events to swap the visibility of the ApplicationControlBar and then you can use show / hide effects to display the control bar.

Resources