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

New commits:
commit f7de88aa5c19c3fd0ecc453bb1623bc9142b3e3b
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Fri Mar 15 23:29:55 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Thu Mar 21 17:12:15 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>
    (cherry picked from commit 612650147cb85e52d317142d022db99a28c0d98a)
    Reviewed-on: https://gerrit.libreoffice.org/69512
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx
index fb2f7e17027b..76563008a893 100644
--- a/vcl/inc/qt5/Qt5Menu.hxx
+++ b/vcl/inc/qt5/Qt5Menu.hxx
@@ -51,6 +51,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 49de2c0305a7..87b4ba4e457e 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -541,6 +541,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