Create a parentless menu bar by copying it from the main window menu bar to be used as the default application menu on Mac OS X.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5003 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
b8f0736968
commit
c27b5a2ebe
|
@ -2870,6 +2870,37 @@ void QtWindow::doInit()
|
||||||
wndWidget()->setMinimumHeight(min - h);
|
wndWidget()->setMinimumHeight(min - h);
|
||||||
else
|
else
|
||||||
wndWidget()->setMinimumHeight(0);
|
wndWidget()->setMinimumHeight(0);
|
||||||
|
|
||||||
|
#ifdef Q_WS_MAC
|
||||||
|
if (m_mainWindow) {
|
||||||
|
// Create a parentless menu bar to be set as the default application menu by copying it from the main window menu
|
||||||
|
DDebug(QtDriver::self(),DebugAll,"Setting as default menu bar the menu bar of window '%s' [%p]",
|
||||||
|
m_id.c_str(),this);
|
||||||
|
QMenuBar* mainMenu = menuBars[0];
|
||||||
|
QMenuBar* defaultMenu = new QMenuBar(0);
|
||||||
|
QList<QAction*> topActions = mainMenu->actions();
|
||||||
|
for (int i = 0; i < topActions.count(); i++) {
|
||||||
|
QMenu* menu = topActions[i]->menu();
|
||||||
|
if (menu) {
|
||||||
|
QMenu* m = new QMenu(menu->title(),defaultMenu);
|
||||||
|
String tmp;
|
||||||
|
QtClient::getProperty(menu,YSTRING("_yate_menuNoCopy"),tmp);
|
||||||
|
if (tmp.toBoolean())
|
||||||
|
continue;
|
||||||
|
defaultMenu->addMenu(m);
|
||||||
|
QList<QAction*> actions = menu->actions();
|
||||||
|
for (int j = 0; j < actions.count(); j++) {
|
||||||
|
QAction* act = actions[j];
|
||||||
|
tmp.clear();
|
||||||
|
QtClient::getProperty(act,YSTRING("_yate_menuNoCopy"),tmp);
|
||||||
|
if (tmp.toBoolean())
|
||||||
|
continue;
|
||||||
|
m->addAction(act);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create window's children dynamic properties from config
|
// Create window's children dynamic properties from config
|
||||||
|
|
|
@ -121,6 +121,9 @@
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>&Friends</string>
|
<string>&Friends</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="_yate_menuNoCopy" stdset="0">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<widget class="QMenu" name="menuSubscription" >
|
<widget class="QMenu" name="menuSubscription" >
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Subscription</string>
|
<string>Subscription</string>
|
||||||
|
@ -3055,6 +3058,9 @@ QTextEdit {
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Show notifications</string>
|
<string>Show notifications</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="_yate_menuNoCopy" stdset="0">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="chatcontact_info" >
|
<action name="chatcontact_info" >
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
|
|
Loading…
Reference in New Issue