mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
systray: fix icon fallback
This commit is contained in:
@@ -116,6 +116,7 @@ Item {
|
|||||||
color: trayItemArea.containsMouse ? Theme.primaryHover : "transparent"
|
color: trayItemArea.containsMouse ? Theme.primaryHover : "transparent"
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
|
id: iconImg
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: Theme.barIconSize(root.barThickness)
|
width: Theme.barIconSize(root.barThickness)
|
||||||
height: Theme.barIconSize(root.barThickness)
|
height: Theme.barIconSize(root.barThickness)
|
||||||
@@ -123,6 +124,21 @@ Item {
|
|||||||
asynchronous: true
|
asynchronous: true
|
||||||
smooth: true
|
smooth: true
|
||||||
mipmap: true
|
mipmap: true
|
||||||
|
visible: status === Image.Ready
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
visible: !iconImg.visible
|
||||||
|
text: {
|
||||||
|
const itemId = trayItem?.id || ""
|
||||||
|
if (!itemId) {
|
||||||
|
return "?"
|
||||||
|
}
|
||||||
|
return itemId.charAt(0).toUpperCase()
|
||||||
|
}
|
||||||
|
font.pixelSize: 10
|
||||||
|
color: Theme.surfaceText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,6 +219,7 @@ Item {
|
|||||||
color: trayItemArea.containsMouse ? Theme.primaryHover : "transparent"
|
color: trayItemArea.containsMouse ? Theme.primaryHover : "transparent"
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
|
id: iconImg
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: Theme.barIconSize(root.barThickness)
|
width: Theme.barIconSize(root.barThickness)
|
||||||
height: Theme.barIconSize(root.barThickness)
|
height: Theme.barIconSize(root.barThickness)
|
||||||
@@ -210,6 +227,21 @@ Item {
|
|||||||
asynchronous: true
|
asynchronous: true
|
||||||
smooth: true
|
smooth: true
|
||||||
mipmap: true
|
mipmap: true
|
||||||
|
visible: status === Image.Ready
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
visible: !iconImg.visible
|
||||||
|
text: {
|
||||||
|
const itemId = trayItem?.id || ""
|
||||||
|
if (!itemId) {
|
||||||
|
return "?"
|
||||||
|
}
|
||||||
|
return itemId.charAt(0).toUpperCase()
|
||||||
|
}
|
||||||
|
font.pixelSize: 10
|
||||||
|
color: Theme.surfaceText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user