https://github.com/amnweb/winmica
A simple Python package to enable Windows 11 Mica effects for PyQt6 applications using the official Windows API.
https://github.com/amnweb/winmica
Last synced: 7 months ago
JSON representation
A simple Python package to enable Windows 11 Mica effects for PyQt6 applications using the official Windows API.
- Host: GitHub
- URL: https://github.com/amnweb/winmica
- Owner: amnweb
- License: mit
- Created: 2025-07-16T17:22:39.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-07-22T01:00:38.000Z (7 months ago)
- Last Synced: 2025-07-22T02:46:46.443Z (7 months ago)
- Language: Python
- Size: 12.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# winmica
A simple Python package to enable Windows 11 Mica effects for PyQt6 applications using the official Windows API.
## Installation
Install this package (from the project root):
```bash
pip install winmica
```
## Usage Example (PyQt6)
```python
from PyQt6.QtWidgets import QApplication, QMainWindow
from PyQt6.QtCore import Qt
from winmica import ApplyMica, MicaType, is_mica_supported
import sys
class MyWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Mica Example")
self.setGeometry(100, 100, 600, 400)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, True)
if is_mica_supported():
hwnd = int(self.winId())
ApplyMica(hwnd, MicaType.MICA)
if __name__ == "__main__":
app = QApplication(sys.argv)
window = MyWindow()
window.show()
sys.exit(app.exec())
```
## Features
- Official Windows 11 Mica Effect
- Simple API: `ApplyMica(hwnd, effect_type)`
- Works with PyQt6 windows (may also work with PySide6 or Tkinter, but not tested)
- Detects system theme (light/dark)
## Effect Types
- `MicaType.MICA` – Standard Mica
- `MicaType.MICA_ALT` – Alternative Mica
- `MicaType.AUTO` – Auto (let Windows decide)
## Result: