Merge branch 'develop' into enhancement/1287-ay-7809_icons-and-colorcoding-for-product-types-in-browser

This commit is contained in:
Jakub Trllo 2025-09-15 14:02:47 +02:00 committed by GitHub
commit 58e71bc95b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -125,16 +125,24 @@ class TaskTypeItem:
icon (str): Icon name in MaterialIcons ("fiber_new").
"""
def __init__(self, name, short, icon):
def __init__(
self,
name: str,
short: str,
icon: str,
color: Optional[str],
):
self.name = name
self.short = short
self.icon = icon
self.color = color
def to_data(self):
return {
"name": self.name,
"short": self.short,
"icon": self.icon,
"color": self.color,
}
@classmethod
@ -147,6 +155,7 @@ class TaskTypeItem:
name=task_type_data["name"],
short=task_type_data["shortName"],
icon=task_type_data["icon"],
color=task_type_data.get("color"),
)

View file

@ -234,10 +234,11 @@ class TasksQtModel(QtGui.QStandardItemModel):
)
icon = None
if task_type_item is not None:
color = task_type_item.color or get_default_entity_icon_color()
icon = get_qt_icon({
"type": "material-symbols",
"name": task_type_item.icon,
"color": get_default_entity_icon_color()
"color": color,
})
if icon is None: