impr(ui.theme): convert CustomPalette to dataclass

This commit is contained in:
2025-11-15 13:20:18 +08:00
parent 0966a3eb40
commit 71e9f05632
4 changed files with 52 additions and 61 deletions

View File

@ -26,20 +26,20 @@ class ThemeQmlExposer(QObject):
@Property(QColor, notify=themeChanged)
def primary(self):
return self._themeImpl.customPalette["primary"]
return self._themeImpl.customPalette.primary
@Property(QColor, notify=themeChanged)
def success(self):
return self._themeImpl.customPalette["success"]
return self._themeImpl.customPalette.success
@Property(QColor, notify=themeChanged)
def error(self):
return self._themeImpl.customPalette["error"]
return self._themeImpl.customPalette.error
@Property(QColor, notify=themeChanged)
def toolTipBase(self):
return self._themeImpl.customPalette["toolTipBase"]
return self._themeImpl.customPalette.toolTipBase
@Property(QColor, notify=themeChanged)
def toolTipText(self):
return self._themeImpl.customPalette["toolTipText"]
return self._themeImpl.customPalette.toolTipText