vcl/inc/qt5/Qt5Menu.hxx |    1 +
 vcl/qt5/Qt5Menu.cxx     |    6 ++++++
 2 files changed, 7 insertions(+)

New commits:
commit 612650147cb85e52d317142d022db99a28c0d98a
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Fri Mar 15 23:29:55 2019 +0100
Commit:     Katarina Behrens <katarina.behr...@cib.de>
CommitDate: Tue Mar 19 20:33:03 2019 +0100

    tdf#123379: implement native menu bar toggle on/off
    
    qt5 didn't provide implementation of virtual SalMenu::ShowMenuBar
    so native menu bar was visible at all times. Hopefully notebookbar
    fans are happier now
    
    Change-Id: Ie581397521369160e16f40231bade40100dcd6f6
    Reviewed-on: https://gerrit.libreoffice.org/69327
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>

diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx
index adac6f6ccdad..b8a451657372 100644
--- a/vcl/inc/qt5/Qt5Menu.hxx
+++ b/vcl/inc/qt5/Qt5Menu.hxx
@@ -54,6 +54,7 @@ public:
     virtual void SetSubMenu(SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, 
unsigned nPos) override;
     virtual void SetFrame(const SalFrame* pFrame) override;
     const Qt5Frame* GetFrame() const;
+    virtual void ShowMenuBar(bool bVisible) override;
     Qt5Menu* GetTopLevel();
     virtual void SetItemBits(unsigned nPos, MenuItemBits nBits) override;
     virtual void CheckItem(unsigned nPos, bool bCheck) override;
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index 4fdebe00f226..6112a7aa4e6c 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -544,6 +544,12 @@ Qt5Menu* Qt5Menu::GetTopLevel()
     return pMenu;
 }
 
+void Qt5Menu::ShowMenuBar(bool bVisible)
+{
+    if (mpQMenuBar && (bVisible != mpQMenuBar->isVisible()))
+        bVisible ? mpQMenuBar->show() : mpQMenuBar->hide();
+}
+
 const Qt5Frame* Qt5Menu::GetFrame() const
 {
     SolarMutexGuard aGuard;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to