feat(*): implement v0.1.0, add docs

This commit is contained in:
h
2026-01-19 01:25:44 +01:00
commit 506a975052
34 changed files with 3285 additions and 0 deletions

84
README.md Normal file
View File

@@ -0,0 +1,84 @@
# pyqt-liquidglass
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md)
macOS Liquid Glass effects for PySide6 and PyQt6.
![Screenshot](assets/screenshot.png)
## Overview
pyqt-liquidglass provides a Python API to apply Apple's native glass visual effects to Qt windows and widgets. On macOS 26+, it uses `NSGlassEffectView` for Liquid Glass. On older versions, it falls back to `NSVisualEffectView`.
## Features
- Apply glass effects to entire windows or specific widgets
- Configure corner radius, padding, and materials
- Reposition, hide, or show window traffic lights
- Automatic Qt binding detection (PySide6, PyQt6)
- Safe no-ops on non-macOS platforms
## Installation
```bash
pip install pyqt-liquidglass
```
Or with uv:
```bash
uv add pyqt-liquidglass
```
## Quick Start
```python
from PySide6.QtWidgets import QApplication, QMainWindow
import pyqt_liquidglass as glass
app = QApplication([])
window = QMainWindow()
window.resize(800, 600)
# Prepare before showing
glass.prepare_window_for_glass(window)
window.show()
# Apply glass after showing
glass.apply_glass_to_window(window)
app.exec()
```
### Sidebar Pattern
```python
# Apply glass to a sidebar widget
glass.apply_glass_to_widget(sidebar, options=glass.GlassOptions.sidebar())
# Position traffic lights
glass.setup_traffic_lights_inset(window, x_offset=18, y_offset=12)
```
### Custom Options
```python
options = glass.GlassOptions(
corner_radius=16.0,
padding=(10, 10, 10, 10),
)
glass.apply_glass_to_window(window, options=options)
```
## Requirements
- Python 3.12+
- macOS
- PySide6 or PyQt6
Tested with PySide6. PyQt6 should work but is not explicitly tested.
## License
MIT