CuteWindow is a modern, cross-platform window library based on PySide6 that provides enhanced control and customization with native window controls and behaviors across different platforms. Create beautiful, customizable applications with ease!
- π₯οΈ 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
Install CuteWindow with a single command:
pip install pyside6-cutewindowCreating 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())CuteWindow provides three main window types for different use cases:
from cutewindow import CuteWindow
window = CuteWindow()
window.setWindowTitle("Basic Window")
window.show()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()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()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()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()- 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
pip install pyside6-cutewindow# 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.pygit clone https://github.com/parhamoyan/cutewindow.git
cd cutewindow
pip install -e .git clone https://github.com/parhamoyan/cutewindow.git
cd cutewindow
pip install -e ".[dev]"
pre-commit installComprehensive documentation is available at https://cutewindow.readthedocs.io
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.pyCuteWindow 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
- Native window shadows via DWM
- Windows 11 snap layout support
- Smooth window animations
- Native window buttons
- Aero Snap functionality
- Native traffic lights (red, yellow, green buttons)
- Smooth window animations
- Full-screen support
- Native window shadows
- Mission Control integration
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)
- 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
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
We welcome contributions! Please see our Contributing Guide for details.
- 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
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
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.pyThis project is licensed under the MIT License - see the LICENSE file for details.
- π§ Email: [email protected]
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Documentation: Read the Docs
- Additional window customization options
- More examples and tutorials
- PyQt6 support
Made with β€οΈ by Parham Oyan

