commit 96a4dd235eae438073b3a2b00c73ff930f7be14a
Author: Daniel Ramoeller <d....@web.de>
Date:   Tue Sep 15 07:31:53 2020 +0200

    Fix for bug #11974
    
    Support for setUnifiedTitleAndToolBarOnMac (unify toolbar and title bar).
---
 src/frontends/qt/GuiView.cpp |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 767791f..9aa325f 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;
                }
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to