Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yjg30737/pyqt-hidable-menubar

PyQt Hidable Menubar (show/hide menu bar with close button at the right corner of it)
https://github.com/yjg30737/pyqt-hidable-menubar

pyqt pyqt-examples pyqt5 pyqt5-examples pyqt5-tutorial python python3 python37 qmenubar qpropertyanimation qpushbutton qt

Last synced: about 5 hours ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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
* pyqt-svg-icon-pushbutton - To svg file button (close button's icon is svg file)

## Usage
You can see the button at the right corner.

![image](https://user-images.githubusercontent.com/55078043/157560268-866c9e48-8a8c-4060-8526-0c8d1ad298ff.png)

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](https://user-images.githubusercontent.com/55078043/157560287-97c6fcfe-7a1f-4a12-940e-6cc9f4049711.png)

## Example
Code Sample
```python
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](https://user-images.githubusercontent.com/55078043/157560268-866c9e48-8a8c-4060-8526-0c8d1ad298ff.png)

Hiding state

![image](https://user-images.githubusercontent.com/55078043/157560287-97c6fcfe-7a1f-4a12-940e-6cc9f4049711.png)