Metadata-Version: 2.4
Name: elua-ui
Version: 0.1.0
Summary: One look for every elua app, in Python: the palette and themes, glass surfaces, springs, type, the controls and the frameless window on Windows 11's Mica or Acrylic, drawn with Qt (PySide6).
Author: 691alpha
License-Expression: MIT OR Apache-2.0
Project-URL: Homepage, https://elua.691alpha.com
Keywords: elua,ui,theme,qt,pyside6,mica,acrylic,glass
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
Classifier: Environment :: Win32 (MS Windows)
Classifier: Environment :: X11 Applications :: Qt
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE-MIT
License-File: LICENSE-APACHE
Requires-Dist: PySide6>=6.6
Requires-Dist: elua-icons>=0.1
Dynamic: license-file

# elua-ui

The look every elua app shares, for Python: the colours, the glass and the
motion of [elua-ui](https://elua.691alpha.com), drawn with
[PySide6](https://pypi.org/project/PySide6/) (Qt).

- **Theme and palette**, the same as the Rust library, colour for colour and
  name for name: light, dark or as Windows is; eleven accents or one of your
  own; three amounts of glass; see-through or solid.
- **The window**: frameless, with Windows 11's Mica or Acrylic behind it,
  rounded corners, the elua title bar (wordmark, name, minimize, maximize,
  close), resize edges and dragging.
- **Controls**: pill buttons, bead (icon) buttons, a switch, a slider,
  segmented choices, a text field and menus, each with elua's spring motion.
- **Icons** from [elua-icons](https://pypi.org/project/elua-icons/), in any
  size and colour.

For whole apps, with ready-made components (cards, lists, settings sections,
banners, toasts…) in a style you pick, use
[elua-design](https://pypi.org/project/elua-design/), which is built on this.

## Install

```powershell
pip install elua-ui
```

Python 3.9 or newer.

## Quick start

```python
import sys
from PySide6.QtWidgets import QApplication
from elua_ui import theme
from elua_ui.theme import Accent
from elua_ui.widgets import Pill, PillKind, Switch
from elua_ui.window import Window

app = QApplication(sys.argv)
theme.set_accent(Accent.IRIS)
win = Window("hello")
win.body_layout.addWidget(Pill("Save", PillKind.PRIMARY))
win.body_layout.addWidget(Switch(True))
win.show()
app.exec()
```

See every piece in a window, in any look:

```powershell
python -m elua_ui --theme dark --accent ocean
```

## The palette

`theme.palette()` is the palette in force; `Palette.new(theme, accent, glass,
translucent, system_dark)` makes any other. Its fields and their values are
the Rust library's: `pal.primary`, `pal.text_dim`, `pal.material(Surface.MENU)`
and so on. Colours are `Color32`, premultiplied like egui's, with `.hex()`,
`.css()` and `.qcolor()`. `theme.on_change(callback)` tells you when the look
changes.

## What's not here yet

- The tab strip, the colour picker, and Snap Layouts on the maximize button.
- elua-ui's own stroke icons: the filled elua-icons set is used instead.
- Mica and Acrylic need Windows 11; elsewhere the window is solid, and the
  look off Windows hasn't been tested.

## Licence

MIT OR Apache-2.0, at your choice.
