]> git.lyx.org Git - lyx.git/commitdiff
Fix for bug #11974
authorDaniel Ramoeller <d.lyx@web.de>
Tue, 15 Sep 2020 05:31:53 +0000 (07:31 +0200)
committerStephan Witt <switt@lyx.org>
Sun, 31 Oct 2021 09:42:14 +0000 (10:42 +0100)
Support for setUnifiedTitleAndToolBarOnMac (unify toolbar and title bar).

src/frontends/qt/GuiView.cpp

index 767791f57b47fab5920b2dead679a788f4816578..9aa325f483dd4ca5e4eb3724c5fcf26b69ec7d3b 100644 (file)
@@ -1039,6 +1039,11 @@ void GuiView::updateLockToolbars()
                if (tb && tb->isMovable())
                        toolbarsMovable_ = true;
        }
+#if QT_VERSION >= 0x050200
+       // set unified mac toolbars only when not movable as recommended:
+       // https://doc.qt.io/qt-5/qmainwindow.html#unifiedTitleAndToolBarOnMac-prop
+       setUnifiedTitleAndToolBarOnMac(!toolbarsMovable_);
+#endif
 }
 
 
@@ -4488,12 +4493,11 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                                        dr.setMessage(_("Toolbars unlocked."));
                                else
                                        dr.setMessage(_("Toolbars locked."));
-                       } else if (GuiToolbar * t = toolbar(name)) {
+                       } else if (GuiToolbar * tb = toolbar(name))
                                // toggle current toolbar movablity
-                               t->movable();
-                               // update lock (all) toolbars positions
-                               updateLockToolbars();
-                       }
+                               tb->movable();
+                       // update lock (all) toolbars positions
+                       updateLockToolbars();
                        break;
                }