yjg30737 / pyqt-hidable-menubar

PyQt Hidable Menubar (show/hide menu bar with close button at the right corner of it)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyqt-hidable-menubar

PyQt Hidable Menubar (show/hide menu bar with close button at the right corner of it)

Showing/hiding menu bar performs little animation.

Fully-responsive as well.

Requirements

  • PyQt5 >= 5.8

Setup

pip3 install git+https://github.com/yjg30737/pyqt-hidable-menubar.git --upgrade

Included Packages

Usage

You can see the button at the right corner.

image

If you click it, menu bar will be hidden but not completely(small space remains).

If you want to show it again, just move the mouse cursor to the space.

image

Example

Code Sample

from PyQt5.QtWidgets import QApplication, QMainWindow, QMenu
from pyqt_hidable_menubar import HidableMenuBar

if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    mainWindow = QMainWindow()
    hidableMenuBar = HidableMenuBar()
    fileMenu = QMenu('File', mainWindow)
    hidableMenuBar.addMenu(fileMenu)
    mainWindow.setMenuBar(hidableMenuBar)
    mainWindow.show()
    app.exec_()

Result

Showing state

image

Hiding state

image

About

PyQt Hidable Menubar (show/hide menu bar with close button at the right corner of it)

License:MIT License


Languages

Language:Python 100.0%