Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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)
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-hidable-menubar
- Owner: yjg30737
- License: mit
- Created: 2022-03-09T23:53:16.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T06:26:29.000Z (almost 2 years ago)
- Last Synced: 2024-12-20T16:28:15.756Z (14 days ago)
- Topics: pyqt, pyqt-examples, pyqt5, pyqt5-examples, pyqt5-tutorial, python, python3, python37, qmenubar, qpropertyanimation, qpushbutton, qt
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 HidableMenuBarif __name__ == "__main__":
import sysapp = 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)