https://github.com/alvii147/mangoui
PyQt6 library for sharper-looking custom-styled widgets
https://github.com/alvii147/mangoui
pyqt6 qss
Last synced: about 1 month ago
JSON representation
PyQt6 library for sharper-looking custom-styled widgets
- Host: GitHub
- URL: https://github.com/alvii147/mangoui
- Owner: alvii147
- License: bsd-3-clause
- Created: 2020-10-09T22:45:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-05T19:07:14.000Z (over 3 years ago)
- Last Synced: 2025-02-16T16:57:57.437Z (4 months ago)
- Topics: pyqt6, qss
- Language: Python
- Homepage:
- Size: 17.6 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Overview
**Mango.UI** is a library for **PyQt6** that includes sharper-looking custom-styled widgets for better desktop UI development. See [documentation](https://alvii147.github.io/MangoUI/build/html/index.html) to learn more.
# Installation & Setup
MangoUI is built on top of [PyQt6](https://pypi.org/project/PyQt6/).
Clone this repository:
```bash
git clone https://github.com/alvii147/MangoUI.git
```Install dependencies:
```bash
pip3 install -r requirements.txt
```# Button
## Example Use
```python
import sys
from PyQt6.QtWidgets import QMainWindow, QApplication, QWidget, QVBoxLayoutfrom MangoUI import Button
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.width = 150
self.height = 150
self.xPos = 600
self.yPos = 400
self.initUI()def initUI(self):
self.setGeometry(self.xPos, self.yPos, self.width, self.height)
self.vBoxLayout = QVBoxLayout()
self.button = Button(
borderWidth = 1,
borderRadius = 4,
)
self.button.setText('Default Button')
self.vBoxLayout.addWidget(self.button)self.blueButton = Button(
primaryColor = (17, 46, 133),
secondaryColor = (202, 209, 232),
borderWidth = 1,
borderRadius = 4,
)
self.blueButton.setText('Blue Button')
self.vBoxLayout.addWidget(self.blueButton)self.redButton = Button(
primaryColor = (171, 3, 3),
secondaryColor = (247, 173, 173),
borderWidth = 1,
borderRadius = 4,
)
self.redButton.setText('Red Button')
self.vBoxLayout.addWidget(self.redButton)self.centralWidget = QWidget(self)
self.centralWidget.setLayout(self.vBoxLayout)
self.setCentralWidget(self.centralWidget)
self.show()if __name__ == '__main__':
app = QApplication(sys.argv)
myWin = Window()
sys.exit(app.exec())
```
# Canvas
## Example Use
```python
import sys
from PyQt6.QtWidgets import QMainWindow, QApplication, QWidget, QVBoxLayout, QLabel
from PyQt6.QtCore import Qtfrom MangoUI import Canvas
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.width = 150
self.height = 150
self.xPos = 600
self.yPos = 400
self.initUI()def initUI(self):
self.setGeometry(self.xPos, self.yPos, self.width, self.height)
self.vBoxLayout = QVBoxLayout()self.canvas = Canvas(
width = 150,
height = 150,
penColor = (21, 21, 21),
canvasColor = (245, 177, 66),
strokeWidth = 5,
borderWidth = 2,
borderColor = (21, 21, 21)
)
self.vBoxLayout.addWidget(self.canvas, alignment = Qt.AlignmentFlag.AlignCenter)self.centralWidget = QWidget(self)
self.centralWidget.setLayout(self.vBoxLayout)
self.setCentralWidget(self.centralWidget)
self.show()if __name__ == '__main__':
app = QApplication(sys.argv)
myWin = Window()
sys.exit(app.exec())
```
# Slider
## Example Use
```python
import sys
from PyQt6.QtWidgets import QMainWindow, QApplication, QLabel, QPushButton, QVBoxLayout, QHBoxLayout, QWidget
from PyQt6.QtCore import Qt, QEasingCurvefrom MangoUI import Slider
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.width = 500
self.height = 500
self.xPos = 600
self.yPos = 400
self.initUI()def initUI(self):
self.setGeometry(self.xPos, self.yPos, self.width, self.height)
self.vBoxLayout = QVBoxLayout()self.slider = Slider(
direction = Qt.Orientation.Horizontal,
duration = 750,
animationType = QEasingCurve.Type.OutQuad,
wrap = False,
)self.label1 = QLabel()
self.label1.setText('First Slide')
self.label1.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label1.setStyleSheet('QLabel{background-color: rgb(245, 177, 66); color: rgb(21, 21, 21); font: 25pt;}')
self.slider.addWidget(self.label1)self.label2 = QLabel()
self.label2.setText('Second Slide')
self.label2.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label2.setStyleSheet('QLabel{background-color: rgb(21, 21, 21); color: rgb(245, 177, 66); font: 25pt;}')
self.slider.addWidget(self.label2)self.label3 = QLabel()
self.label3.setText('Third Slide')
self.label3.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label3.setStyleSheet('QLabel{background-color: rgb(93, 132, 48); color: rgb(245, 177, 66); font: 25pt;}')
self.slider.addWidget(self.label3)self.buttonPrevious = QPushButton()
self.buttonPrevious.setText('Previous Slide')
self.buttonPrevious.clicked.connect(self.slider.slidePrevious)self.buttonNext = QPushButton()
self.buttonNext.setText('Next Slide')
self.buttonNext.clicked.connect(self.slider.slideNext)self.buttonLayout = QHBoxLayout()
self.buttonLayout.addWidget(self.buttonPrevious)
self.buttonLayout.addWidget(self.buttonNext)self.vBoxLayout.addWidget(self.slider)
self.vBoxLayout.addLayout(self.buttonLayout)self.centralWidget = QWidget(self)
self.centralWidget.setLayout(self.vBoxLayout)
self.setCentralWidget(self.centralWidget)self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
myWin = Window()
sys.exit(app.exec())
```
# TagBox
## Example Use
```python
import sys
from PyQt6.QtWidgets import QMainWindow, QApplication, QWidget, QVBoxLayout, QLineEdit, QPushButtonfrom MangoUI import TagBox
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.width = 450
self.height = 250
self.xPos = 600
self.yPos = 400
self.initUI()def initUI(self):
self.setGeometry(self.xPos, self.yPos, self.width, self.height)
self.vBoxLayout = QVBoxLayout()
self.tagbox = TagBox()
self.tagbox.addTag('Homelander')
self.tagbox.addTag('Queen Maeve')
self.tagbox.addTag('Black Noir')
self.tagbox.addTag('Transluscent')
self.tagbox.addTag('A-Train')
self.tagbox.addTag('The Deep')
self.vBoxLayout.addWidget(self.tagbox)self.tagEdit = QLineEdit()
self.vBoxLayout.addWidget(self.tagEdit)self.addButton = QPushButton()
self.addButton.setText('Add New Tag')
self.addButton.clicked.connect(self.addNewTag)
self.vBoxLayout.addWidget(self.addButton)self.centralWidget = QWidget(self)
self.centralWidget.setLayout(self.vBoxLayout)
self.setCentralWidget(self.centralWidget)
self.show()def addNewTag(self):
self.tagbox.addTag(self.tagEdit.text())if __name__ == '__main__':
app = QApplication(sys.argv)
myWin = Window()
sys.exit(app.exec())
```
![]()