12-30-2012 05:52 PM
In the documentation the best practice is to attach application menu under root element.
My root element is TabbedPane. All documentation examples assume root element is NavigationPane or Page in which you just push the settings page or display elements which represent settings page.
How would you implement actual help / settings pages where application menu is under NavigationPane and there is no way to push new pages in (unless its under a tab).
12-30-2012 06:03 PM
It's no longer possible to wrap TabbedPane into a NavigationPane. So you can't push the Settings page to the stack. ![]()
Known options are:
- Disable the Application Menu and implement Settings as a tab.
- Show Settings in a Sheet.
- A complex workaround: ensure all your Tab pages contain Navigation Panes. When Settings or Help action is activated, get top level TabbedPane: (TabbedPane *)Application::instance()->scene(). Then push SettingsPage into active Tab's NavigationPane.
12-31-2012 01:34 AM - edited 12-31-2012 01:36 AM
i would suggest using a Sheet. The biggest benefit of using 'Sheet' for menu items is that you can't keep stacking menu item pages...so it garantees that only one instance of your menu page is opened at any time.
You can put a navigationpane inside the sheet, then have a page pushed when the sheet is created to fake the back button.
but the only drawback is that 'annoying' sheet animation that i couldn't get rid of ![]()
12-31-2012 02:05 AM
My root is also a TabbedPane,
each Tab is a NavigationPane, so I can have a stack of Pages on each Tab
ApplicationMenu are Sheets, where Sheet can cover a WebView (Help) or NavigationPane (Settings, ...)
12-31-2012 03:42 AM
i would suggest using a Sheet. The biggest benefit of using 'Sheet' for menu items is that you can't keep stacking menu item pages...so it garantees that only one instance of your menu page is opened at any time.
This can be worked around for NavigationPane too:
Application::Application(QObject *parent)
: QObject(parent)
, helpPage_(NULL)
, settingsPage_(NULL)
---
void Application::settingsAction_triggered()
{
if (settingsPage_)
return;
settingsPage_ = new SettingsPage;
Application::instance()->setMenuEnabled(false);
pane_->push(settingsPage_);
}
---
Same for helpPage_
---
void Application::popTransitionEnded(bb::cascades::Page * page)
{
if (page == helpPage_)
{
helpPage_ = NULL;
Application::instance()->setMenuEnabled(true);
}
else if (page == settingsPage_)
{
settingsPage_ = NULL;
Application::instance()->setMenuEnabled(true);
}
delete page;
}
but the only drawback is that 'annoying' sheet animation that i couldn't get rid of
Another drawback is the Sheet can't be closed using peek gesture. ![]()