From: Daniel Ramoeller Date: Tue, 15 Sep 2020 05:31:53 +0000 (+0200) Subject: Fix for bug #11974 X-Git-Tag: 2.4-beta2~1061 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=96a4dd235eae438073b3a2b00c73ff930f7be14a;p=lyx.git Fix for bug #11974 Support for setUnifiedTitleAndToolBarOnMac (unify toolbar and title bar). --- diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index 767791f57b..9aa325f483 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -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; }