1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

fix toast style

This commit is contained in:
bbedward
2025-08-25 10:19:00 -04:00
parent 7e03076a20
commit 4a0825e27f

View File

@@ -77,14 +77,14 @@ PanelWindow {
case ToastService.levelWarn:
return Theme.warning
case ToastService.levelInfo:
return Theme.primary
return Theme.surfaceContainer
default:
return Theme.primary
return Theme.surfaceContainer
}
}
radius: Theme.cornerRadius
layer.enabled: true
opacity: shouldBeVisible ? 0.9 : 0
opacity: shouldBeVisible ? 1 : 0
Column {
id: toastContent
@@ -116,7 +116,15 @@ PanelWindow {
}
}
size: Theme.iconSize
color: Theme.background
color: {
switch (ToastService.currentLevel) {
case ToastService.levelError:
case ToastService.levelWarn:
return SessionData.isLightMode ? Theme.surfaceText : Theme.background
default:
return Theme.surfaceText
}
}
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
}
@@ -125,7 +133,15 @@ PanelWindow {
id: messageText
text: ToastService.currentMessage
font.pixelSize: Theme.fontSizeMedium
color: Theme.background
color: {
switch (ToastService.currentLevel) {
case ToastService.levelError:
case ToastService.levelWarn:
return SessionData.isLightMode ? Theme.surfaceText : Theme.background
default:
return Theme.surfaceText
}
}
font.weight: Font.Medium
anchors.left: statusIcon.right
anchors.leftMargin: Theme.spacingM
@@ -140,7 +156,15 @@ PanelWindow {
id: expandButton
iconName: toast.expanded ? "expand_less" : "expand_more"
iconSize: Theme.iconSize
iconColor: Theme.background
iconColor: {
switch (ToastService.currentLevel) {
case ToastService.levelError:
case ToastService.levelWarn:
return SessionData.isLightMode ? Theme.surfaceText : Theme.background
default:
return Theme.surfaceText
}
}
buttonSize: Theme.iconSize + 8
anchors.right: closeButton.left
anchors.rightMargin: 2
@@ -161,7 +185,15 @@ PanelWindow {
id: closeButton
iconName: "close"
iconSize: Theme.iconSize
iconColor: Theme.background
iconColor: {
switch (ToastService.currentLevel) {
case ToastService.levelError:
case ToastService.levelWarn:
return SessionData.isLightMode ? Theme.surfaceText : Theme.background
default:
return Theme.surfaceText
}
}
buttonSize: Theme.iconSize + 8
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
@@ -185,7 +217,15 @@ PanelWindow {
id: detailsText
text: ToastService.currentDetails
font.pixelSize: Theme.fontSizeSmall
color: Theme.background
color: {
switch (ToastService.currentLevel) {
case ToastService.levelError:
case ToastService.levelWarn:
return SessionData.isLightMode ? Theme.surfaceText : Theme.background
default:
return Theme.surfaceText
}
}
isMonospace: true
anchors.left: parent.left
anchors.right: copyButton.left
@@ -199,7 +239,15 @@ PanelWindow {
id: copyButton
iconName: "content_copy"
iconSize: Theme.iconSizeSmall
iconColor: Theme.background
iconColor: {
switch (ToastService.currentLevel) {
case ToastService.levelError:
case ToastService.levelWarn:
return SessionData.isLightMode ? Theme.surfaceText : Theme.background
default:
return Theme.surfaceText
}
}
buttonSize: Theme.iconSizeSmall + 8
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter