Skip to main content

Reusable PySide6 UI toolkit primitives for SLI desktop tools.

Project description

SLI UI Toolkit

Reusable PySide6 widgets and UI infrastructure for compact desktop tools.

SLI stands for Shared Lightweight Interface. The toolkit was extracted from Improve-ImgSLI and Tkonverter, but host-specific icons, translations, resources, and business logic stay outside the library.

What Is Included

  • custom-painted compact controls: buttons, inputs, switches, sliders, labels;
  • a unified Button system with icons, text, toggle, scroll, menu, long-press, ripple, and multi-region split layouts;
  • reusable composite widgets: flyouts, dialog shells, markdown help, timelines, toasts, lists, charts;
  • theme-aware painting through ThemeManager tokens;
  • app-injected hooks for icons, i18n, overlay placement, and timing.

Install

For development from this repository:

python -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e ".[dev]"

For use as a dependency:

python -m pip install sli-ui-toolkit

Run The Demo

From the repository root:

python -m demo

The demo opens a PyQt window with widget pages for buttons, inputs, lists, dialogs, flyouts, charts, feedback, and miscellaneous primitives.

If you run on a headless machine, set Qt's platform first:

QT_QPA_PLATFORM=offscreen python -m demo

Run Tests

pytest tests/

The test suite uses pytest-qt and defaults to offscreen Qt through tests/conftest.py.

Basic Use

Most application code should import from sli_ui_toolkit.widgets.

from PySide6.QtWidgets import QApplication, QVBoxLayout, QWidget

from sli_ui_toolkit.theme import ThemeManager
from sli_ui_toolkit.widgets import Button, ComboBox

app = QApplication([])

theme = ThemeManager.get_instance()
theme.set_theme("light", app)

window = QWidget()
layout = QVBoxLayout(window)

save = Button("save", text="Save", variant="surface")
mode = ComboBox()
mode.addItems(["Fast", "Balanced", "Quality"])

layout.addWidget(save)
layout.addWidget(mode)
window.show()

app.exec()

App Configuration Hooks

Hosts can inject app-specific behavior at startup:

  • configure_icon_resolver(...) Supplies icon lookup for app icon enums, names, or resources.
  • configure_toolkit(...) Supplies overlay placement and timing defaults for flyouts and popups.
  • configure_i18n(...) Supplies translation roots and language handling.

Minimal apps can use bundled toolkit icons and skip these hooks. Larger host apps should configure them once during startup.

Public Import Layers

  • sli_ui_toolkit Bootstrap/configuration helpers and common primitives.
  • sli_ui_toolkit.widgets Main public widget catalog. Prefer this for application UI.
  • sli_ui_toolkit.theme ThemeManager.
  • sli_ui_toolkit.icons Icon resolver configuration.
  • sli_ui_toolkit.i18n Translation manager and helpers.
  • sli_ui_toolkit.managers Flyout and timer helpers.
  • sli_ui_toolkit.services Utility services such as prewarm helpers.

Everything under sli_ui_toolkit.ui... is implementation detail first. Use it inside toolkit internals, or only when no public export exists yet.

Documentation

Development Notes

  • Keep host-app behavior outside the toolkit. Pass behavior through callbacks, signals, configuration hooks, or plain data objects.
  • Resolve colors and sizes through ThemeManager, widget properties, or documented tokens.
  • Update docs when changing public widget behavior or public API.
  • Run pytest tests/ before publishing or tagging a release.

Caveats

  • ComboBox is custom-painted; it is not a full QComboBox drop-in replacement.
  • The toolkit is designed around custom-painted controls, not QSS-skinned stock widgets.
  • Light and dark themes are both first-class. Avoid hard-coded colors in custom widgets; use theme tokens.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sli_ui_toolkit-0.3.0.tar.gz (305.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sli_ui_toolkit-0.3.0-py3-none-any.whl (294.0 kB view details)

Uploaded Python 3

File details

Details for the file sli_ui_toolkit-0.3.0.tar.gz.

File metadata

  • Download URL: sli_ui_toolkit-0.3.0.tar.gz
  • Upload date:
  • Size: 305.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sli_ui_toolkit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6ae166e3af5de675d6141d7d242e8b19e955b7af0ce7fdfba4c8b0878a380f38
MD5 a27055ed39136dda69d9b04503216928
BLAKE2b-256 bee29f8bc5bb1db0cdc4ce2f48c6d5e2eb62ac79e5607416f87c6c8c460f1aed

See more details on using hashes here.

Provenance

The following attestation bundles were made for sli_ui_toolkit-0.3.0.tar.gz:

Publisher: publish.yml on Loganavter/sli-ui-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sli_ui_toolkit-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: sli_ui_toolkit-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 294.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sli_ui_toolkit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d578f1b928aa363904dd8695d508d8d92335bb72c770365caa788c60887010b7
MD5 87b389e05266999f5e4f7ea42cf6ba90
BLAKE2b-256 af1916b730a387fc976dfb6ae16ff172be6c171b981ac329ca630601e499eba4

See more details on using hashes here.

Provenance

The following attestation bundles were made for sli_ui_toolkit-0.3.0-py3-none-any.whl:

Publisher: publish.yml on Loganavter/sli-ui-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page