Cross-platform customizable window library based on PySide6 with enhanced control
Project description
CuteWindow
CuteWindow is a modern, cross-platform window library for Python and Qt that provides enhanced control and customization with native window controls and behaviors across different platforms. Create beautiful, customizable applications with ease!
โจ Features
- ๐ฅ๏ธ Cross-platform: Works seamlessly on Windows and macOS
- ๐จ Enhanced control: Customizable window appearance with flexible styling options
- ๐๏ธ Native controls: Platform-specific window buttons and behaviors
- ๐ฏ Customizable: Easy to customize title bar appearance and functionality
- ๐ฑ High-DPI support: Automatic scaling for high-resolution displays
- โจ Native animations: Smooth window animations and shadows
- ๐ช Win11 snap layout: Windows 11 snap layout support
- ๐ง Easy integration: Drop-in replacement for standard Qt windows
๐ Quick Start
Installation
Install CuteWindow with a single command:
pip install pyside6-cutewindow
Basic Usage
Creating a customizable window is as simple as:
import sys
from PySide6.QtWidgets import QApplication
from cutewindow import CuteWindow
if __name__ == "__main__":
app = QApplication(sys.argv)
window = CuteWindow()
window.setWindowTitle("My Customizable App")
window.resize(800, 600)
window.show()
sys.exit(app.exec())
Window Types
CuteWindow provides three main window types for different use cases:
CuteWindow (Basic)
from cutewindow import CuteWindow
window = CuteWindow()
window.setWindowTitle("Basic Window")
window.show()
CuteMainWindow (Advanced)
from cutewindow import CuteMainWindow
from PySide6.QtWidgets import QMenuBar, QMenu, QAction
window = CuteMainWindow()
window.setWindowTitle("Main Window")
# Add menu bar
menubar = QMenuBar()
file_menu = QMenu("File", menubar)
exit_action = QAction("Exit", menubar)
file_menu.addAction(exit_action)
menubar.addMenu(file_menu)
window.setMenuBar(menubar)
window.show()
CuteDialog (Dialogs)
from cutewindow import CuteDialog
from PySide6.QtWidgets import QPushButton, QVBoxLayout, QWidget
dialog = CuteDialog()
dialog.setWindowTitle("Dialog")
dialog.setModal(True)
# Add content
layout = QVBoxLayout()
button = QPushButton("Close")
button.clicked.connect(dialog.close)
layout.addWidget(button)
container = QWidget()
container.setLayout(layout)
dialog.setCentralWidget(container)
dialog.exec()
๐จ Customization
Styling the Title Bar
from cutewindow import CuteWindow
window = CuteWindow()
# Style the title bar using CSS
window.setStyleSheet("""
#TitleBar {
background-color: #2b2b2b;
border-bottom: 1px solid #3a3a3a;
}
""")
window.show()
Custom Title Bar Widget
from PySide6.QtWidgets import QLabel, QPushButton, QHBoxLayout, QWidget
from cutewindow import CuteWindow, TitleBar
class CustomTitleBar(TitleBar):
def __init__(self, parent=None):
super().__init__(parent)
# Create custom layout
layout = QHBoxLayout(self)
layout.setContentsMargins(10, 0, 10, 0)
# Add title label
title_label = QLabel("Custom Title")
title_label.setStyleSheet("color: white; font-weight: bold;")
layout.addWidget(title_label)
layout.addStretch()
# Add custom buttons
help_btn = QPushButton("?")
help_btn.setFixedSize(30, 20)
layout.addWidget(help_btn)
window = CuteWindow()
window.setTitleBar(CustomTitleBar(window))
window.show()
๐ผ๏ธ Screenshots
CuteWindow on macOS
CuteWindow on Windows
๐ Requirements
- Python: 3.9 or higher
- Poetry: Dependency management (recommended)
- PySide6: Qt6 bindings for Python
- Platform-specific dependencies:
- macOS: pyobjc-framework-Cocoa, pyobjc-framework-Quartz
- Windows: pywin32
๐ง Installation
From PyPI (Recommended)
pip install pyside6-cutewindow
From Source with Poetry (Recommended for Development)
# Clone the repository
git clone https://github.com/parhamoyan/cutewindow.git
cd cutewindow
# Install Poetry (if not already installed)
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install
# Set up development environment
poetry install --with dev
# Set up pre-commit hooks
poetry run python scripts/setup_precommit.py
From Source with pip
git clone https://github.com/parhamoyan/cutewindow.git
cd cutewindow
pip install -e .
Development Installation with pip
git clone https://github.com/parhamoyan/cutewindow.git
cd cutewindow
pip install -e ".[dev]"
pre-commit install
๐ Documentation
Comprehensive documentation is available at https://pyside6-cutewindow.readthedocs.io
๐ฏ Examples
Check out the examples/ directory for more comprehensive examples:
demo.py- Basic usage exampledemo_custom_title_bar.py- Custom title bar implementationdemo_login_dialog.py- Login dialog exampledemo_title_bar_style.py- Title bar styling example
Run an example:
python examples/demo.py
๐๏ธ Architecture
CuteWindow uses a clean, modular architecture:
cutewindow/
โโโ __init__.py # Main package interface
โโโ base.py # Abstract base classes
โโโ Icon.py # Enhanced icon handling
โโโ platforms/ # Platform-specific implementations
โ โโโ __init__.py # Platform detection
โ โโโ mac/ # macOS implementation
โ โ โโโ CuteWindow.py
โ โ โโโ CuteMainWindow.py
โ โ โโโ CuteDialog.py
โ โ โโโ TitleBar.py
โ โ โโโ utils.py
โ โโโ windows/ # Windows implementation
โ โโโ CuteWindow.py
โ โโโ CuteMainWindow.py
โ โโโ CuteDialog.py
โ โโโ TitleBar.py
โ โโโ utils.py
โ โโโ native_event.py
โ โโโ c_structures.py
โโโ examples/ # Usage examples
Platform-Specific Features
Windows
- Native window shadows via DWM
- Windows 11 snap layout support
- Smooth window animations
- Native window buttons
- Aero Snap functionality
macOS
- Native traffic lights (red, yellow, green buttons)
- Smooth window animations
- Full-screen support
- Native window shadows
- Mission Control integration
๐ CI/CD
CuteWindow uses GitHub Actions for continuous integration and deployment:
-
CI Pipeline: Runs on every push and pull request to ensure code quality
- Tests across multiple Python versions (3.8-3.12) and platforms (Windows, macOS, Linux)
- Code formatting checks (Black, isort)
- Linting (flake8)
- Type checking (mypy)
- Security scanning (safety, bandit)
- Package building and installation testing
-
Documentation: Automatically builds and deploys documentation to Read the Docs
-
Code Quality: Comprehensive quality checks and security scanning
-
Automated Publishing: Publishes to PyPI when new tags are created
Quality Checks
The CI pipeline enforces the following quality standards:
- Code Style: Black formatting and isort import sorting
- Type Safety: Mypy static type checking
- Code Quality: Flake8 linting with strict rules
- Security: Dependency and code security scanning
- Code Quality: Comprehensive quality checks and security scanning
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/cutewindow.git - Navigate to the project:
cd cutewindow - Install dependencies with Poetry:
poetry install --with dev - Set up pre-commit hooks:
poetry run python scripts/setup_precommit.py - Create your feature branch:
git checkout -b feature/amazing-feature - Make your changes and ensure they pass quality checks:
poetry run python scripts/quality_check.py - Run quality checks:
poetry run python scripts/quality_check.py - Format your code:
poetry run python scripts/format_code.pyorpoetry run black . && poetry run isort . - Commit your changes:
git commit -m 'feat: add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Code Style
We use:
- Black for code formatting
- isort for import sorting
- flake8 for linting
- mypy for type checking
- bandit for security scanning
- safety for dependency safety
Development Tools
The project includes several convenience scripts:
# Run comprehensive quality checks
poetry run python scripts/quality_check.py
# Run quality checks
poetry run python scripts/quality_check.py
# Auto-format code
poetry run python scripts/format_code.py
# Set up pre-commit hooks
poetry run python scripts/setup_precommit.py
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support
- ๐ง Email: parhamoyan@yahoo.com
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ Documentation: Read the Docs
๐บ๏ธ Roadmap
- Additional window customization options
- More examples and tutorials
- PyQt6 support
Made with โค๏ธ by Parham Oyan
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyside6_cutewindow-0.1.1.tar.gz.
File metadata
- Download URL: pyside6_cutewindow-0.1.1.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba8a5bec49bc86f122b8f179f5b86750527f6caadfa82e3da097698c9bc091b9
|
|
| MD5 |
5b3914d64e6fdd83ae6c4b037f12cc62
|
|
| BLAKE2b-256 |
01a6819769de77b809b4b408f18d988c97fb565f158c42956f1a43af895ecdb2
|
Provenance
The following attestation bundles were made for pyside6_cutewindow-0.1.1.tar.gz:
Publisher:
release.yml on parhamoyan/cutewindow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyside6_cutewindow-0.1.1.tar.gz -
Subject digest:
ba8a5bec49bc86f122b8f179f5b86750527f6caadfa82e3da097698c9bc091b9 - Sigstore transparency entry: 560843053
- Sigstore integration time:
-
Permalink:
parhamoyan/cutewindow@077442e1919c3ef0306dfa839b09521d3ed98731 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/parhamoyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@077442e1919c3ef0306dfa839b09521d3ed98731 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyside6_cutewindow-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyside6_cutewindow-0.1.1-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0daabbc19d756314beb8c175242400ba05d6dcbec1ccfb647bb029fd341e7b5
|
|
| MD5 |
a684d90b8a81359061bf6d23f7dd9707
|
|
| BLAKE2b-256 |
9c34d08a356bbb6098471f1186ef85fbf0b2b83fa2731e7543ba7110457cf33c
|
Provenance
The following attestation bundles were made for pyside6_cutewindow-0.1.1-py3-none-any.whl:
Publisher:
release.yml on parhamoyan/cutewindow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyside6_cutewindow-0.1.1-py3-none-any.whl -
Subject digest:
b0daabbc19d756314beb8c175242400ba05d6dcbec1ccfb647bb029fd341e7b5 - Sigstore transparency entry: 560843082
- Sigstore integration time:
-
Permalink:
parhamoyan/cutewindow@077442e1919c3ef0306dfa839b09521d3ed98731 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/parhamoyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@077442e1919c3ef0306dfa839b09521d3ed98731 -
Trigger Event:
push
-
Statement type: