Dienstag, 26. September 2017

How to toggle the menubar in libreoffice under GNOME3

1) Navigate to "Tools -> Macros -> Organise Macros -> LibreOffice Basic"





2) Navigate to "My Macros -> Standard -> Module1" in the tree view below and select "Module1" then select "edit" 



3) Insert the following code into the Module1 Macro


Sub HideMenuBar
layout = Thiscomponent.CurrentController.Frame.LayoutManager
layout.hideElement("private:resource/menubar/menubar")
End Sub


Sub ShowMenuBar
layout = Thiscomponent.CurrentController.Frame.LayoutManager
layout.showElement("private:resource/menubar/menubar")

End Sub



4) Switch back to the libreoffice main window (writer/calc/whatever) and rightclick the toolbar where you want to add the macros and click on "customize toolbar"



5) Click on "Add Command"

6) Scroll down and navigate to "LibreOffice Macros -> My Macros -> Standard -> Module1" and add both "HideMenubar" and "ShowMenuBar" by clicking on "Add"