$ show phenom-films/dayu_widgets
dayu_widgets is a Python UI component library for PySide2/PySide6/PyQt5, inspired by Ant Design. It provides a cohesive set of themed widgets (buttons, inputs, tables, menus, dialogs, etc.) with light/dark themes and customizable primary colors. The architecture is modular: each widget lives in its own module, a central theme object applies QSS styling, and mixin decorators add cross-cutting behavior. The package is distributed via PyPI and includes a demo launcher (`python -m dayu_widgets`) plus 30+ example scripts. Under the hood, the library implements a QSS template engine with @-variable substitution, an AntDesign-based color palette generator, a Qt Model/View data layer with lazy loading and filtering, and a field-mixin data binding system. These components are the most reusable parts and demonstrate solid engineering. However, test coverage is limited to a subset of widgets, and the codebase contains numerous workarounds for Qt binding differences (PySide2 vs PySide6 vs PyQt5) that add fragility. The project is actively maintained with recent commits, CI, and semantic versioning.
The LLM identified 5 files worth highlighting for reuse:
Implements MTheme with light/dark palettes and a QSS template engine using @-delimited variables. The AntDesign-based color generation and fade algorithms are self-contained and can be extracted to style any Qt application.
Provides reusable decorators (cursor_mixin, focus_shadow_mixin, hover_shadow_mixin, property_mixin, stacked_animation_mixin) that add consistent behavior to QWidget subclasses. Each decorator is independent and can be applied to new widget classes with minimal coupling.
MTableModel and MSortFilterModel implement a Qt Model/View data layer with custom headers, checkable/editable columns, lazy generator-based loading, and built-in search/filtering. This is a reusable MVC pattern for any PySide/PyQt table or tree view.
Central Qt compatibility layer providing an application() context manager and MIcon/MPixmap classes with SVG caching. It abstracts PySide2/PySide6/PyQt5 differences and can be reused as a lightweight Qt bootstrap module.
MFieldMixin enables two-way data binding between widget properties and a field dictionary, reducing boilerplate for forms and inspectors. The binding mechanism is generic and can be applied to any Qt widget hierarchy.