]> git.lyx.org Git - features.git/commitdiff
Override QMainWindow::menuBar() in LyX GuiView class on Mac OSX.
authorStephan Witt <switt@lyx.org>
Sun, 26 Jan 2014 17:40:23 +0000 (18:40 +0100)
committerStephan Witt <switt@lyx.org>
Sun, 26 Jan 2014 17:40:23 +0000 (18:40 +0100)
This fixes the issue with missing menu entry for "Insert Branch <branch name>".

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h
status.20x

index fff7f24fd41385ab4de3550257360da894ae2ab6..6195195252c94c4f09bb052d4287fdb10ba1d45b 100644 (file)
@@ -425,13 +425,8 @@ GuiView::GuiView(int id)
        // they are greyed out.
        guiApp->setCurrentView(this);
  
-#if defined(Q_WS_MACX)
-       static QMenuBar * qmb = new QMenuBar(0);
-#else
-       QMenuBar * qmb = menuBar();
-#endif
        // Fill up the menu bar.
-       guiApp->menus().fillMenuBar(qmb, this, true);
+       guiApp->menus().fillMenuBar(menuBar(), this, true);
 
        setCentralWidget(d.stack_widget_);
 
@@ -533,6 +528,15 @@ QVector<GuiWorkArea*> GuiView::GuiViewPrivate::guiWorkAreas()
 }
 
 
+#if defined(Q_WS_MACX)
+QMenuBar * GuiView::menuBar() const
+{
+       static QMenuBar * globalMenuBar = new QMenuBar(0);
+       return globalMenuBar;
+}
+#endif
+
+
 #if QT_VERSION >= 0x040400
 
 void GuiView::processingThreadStarted()
index 667ce607881ecb7f6b7fb3c084e237c30c3ebfa3..02199c1a98c39d53d4d85072fb13b387ab08e135 100644 (file)
@@ -137,6 +137,13 @@ public:
        GuiToolbar * makeToolbar(ToolbarInfo const & tbinfo, bool newline);
        void updateStatusBar();
 
+#if defined(Q_WS_MACX)
+       // We have to share one menu bar, so we must create a menu bar that does not have a parent.
+       // To enforce this we override the QMainWindow::menuBar() implementation.
+       // See https://bugreports.qt-project.org/browse/QTBUG-25399
+       QMenuBar *menuBar() const;
+#endif
+
        /// updates the possible layouts selectable
        void updateLayoutList();
        void updateToolbars();
index 1aaa5e251df7e974199891ed9989d822e532a790..4bb42109419c570a2c016662fb0133137ceb424f 100644 (file)
@@ -55,8 +55,9 @@ What's new
 
 * USER INTERFACE
 
-Fixed python call in listerrors script.
+Fixed python call in listerrors script.
 
+- Fix the missing menu entry for "Insert Branch <branch name>".
 
 * DOCUMENTATION AND LOCALIZATION