Skip to main content

Reusable PyQt UI toolkit primitives for SLI desktop tools.

Project description

SLI UI Toolkit

sli-ui-toolkit is a reusable PyQt6 widget and UI-support library. SLI stands for Shared Lightweight Interface.

It was extracted from two production apps, Improve-ImgSLI and Tkonverter. That history is still visible in some widget choices and naming, but the package is maintained as a general-purpose toolkit: host-specific behavior is kept outside the library and injected through configuration hooks.

Use it when you want:

  • custom-painted compact controls;
  • a unified button system;
  • theme-aware widgets and flyouts;
  • app-injected icons, translations, and overlay behavior.

Start Here

This file is the integration entry point, not the full reference.

Import Layers

Use these import layers on purpose:

  • sli_ui_toolkit Small top-level bootstrap surface.
  • sli_ui_toolkit.widgets Main public widget catalog.
  • sli_ui_toolkit.i18n Translation manager and helpers.
  • sli_ui_toolkit.icons Icon resolver configuration.
  • sli_ui_toolkit.theme Theme manager.
  • sli_ui_toolkit.managers Flyout and timer helpers.
  • sli_ui_toolkit.services Utility services such as prewarm helpers.

If you are building app UI, most of the time you want sli_ui_toolkit.widgets.

Configuration Hooks

App-specific behavior is injected at startup:

  • configure_icon_resolver(...)
  • configure_toolkit(...)
  • configure_i18n(...)

These hooks keep the toolkit reusable while letting the host app supply:

  • icon lookup;
  • translation roots;
  • overlay-layer resolution;
  • timing constants.

Quick Start

from pathlib import Path

from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout

from sli_ui_toolkit import FlyoutTimingConfig, configure_i18n, configure_toolkit
from sli_ui_toolkit.icons import configure_icon_resolver
from sli_ui_toolkit.theme import ThemeManager
from sli_ui_toolkit.widgets import Button, ComboBox, install_application_tooltips

app = QApplication([])

theme = ThemeManager.get_instance()
theme.register_palettes(light_palette={...}, dark_palette={...})
theme.register_qss_path(str(Path("resources/qss/app.qss")))
theme.set_theme("light", app)

configure_icon_resolver(resolver=my_icon_lookup)

configure_toolkit(
    timings=FlyoutTimingConfig(
        transient_auto_hide_delay_ms=300,
        flyout_animation_duration_ms=150,
        text_settings_flyout_animation_duration_ms=150,
    ),
    overlay_resolver=lambda widget: getattr(widget.window(), "overlay_layer", None),
)

configure_i18n(i18n_root=Path("resources/i18n"))
install_application_tooltips(app)

window = QWidget()
layout = QVBoxLayout(window)

save_button = Button("save", text="Save", variant="primary")
mode_combo = ComboBox()
mode_combo.addItems(["Fast", "Balanced", "Quality"])

layout.addWidget(save_button)
layout.addWidget(mode_combo)
window.show()

app.exec()

Flyouts, button dropdown menus, and similar in-window surfaces use overlay_resolver when a host app provides an overlay layer. The resolved object should expose host, attach(widget), anchor_rect(anchor), and clamp_rect(rect, margin=...). If no overlay layer is resolved, button dropdown menus fall back to the top-level window and position themselves in window coordinates. Menu surfaces are painted from flyout.background / flyout.border; individual rows only use list_item.background.hover for the hovered or current item.

First Widgets To Reach For

  • Button Unified icon/text/toggle/menu/scrollable button system.
  • ComboBox Custom-painted combo box with popup, search, and keyboard navigation.
  • CustomLineEdit Themed editable text field.
  • SidebarDialogShell Settings/help style dialog shell.
  • ScrollableDialogPage Scrollable dialog page container.
  • MarkdownHelpDialog Reusable markdown help/documentation dialog.

Usage details live in docs/API_CATALOG.md.

Notes

  • ComboBox is a custom widget, not a full QComboBox drop-in replacement.
  • The toolkit is designed around custom-painted controls, not QSS-skinned stock widgets.
  • App-specific icons and translations should stay outside the toolkit and be injected through configuration.

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.2.8.tar.gz (178.4 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.2.8-py3-none-any.whl (246.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sli_ui_toolkit-0.2.8.tar.gz
  • Upload date:
  • Size: 178.4 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.2.8.tar.gz
Algorithm Hash digest
SHA256 73eb6eba5257d7cf91e38a393a4462cc6f12980d24037ef025ff84c893f77db2
MD5 d0a42a63343357ec8e6df8e4e2af3bfa
BLAKE2b-256 436d844a738f5a358717d4fd5f6d14ad7de837d8055420363c6e1c062dcf96de

See more details on using hashes here.

Provenance

The following attestation bundles were made for sli_ui_toolkit-0.2.8.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.2.8-py3-none-any.whl.

File metadata

  • Download URL: sli_ui_toolkit-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 246.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.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 68e360e879999e5c40cba6b0d9063403e44b7487d13c77331e1d2e1acb9386dc
MD5 55519b9238538e9460a219f15e92b067
BLAKE2b-256 e45c2d6381c82b0efcb062339290fb897056e952788b129bcec0cc6fe84d0d66

See more details on using hashes here.

Provenance

The following attestation bundles were made for sli_ui_toolkit-0.2.8-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