1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 22:42:50 -05:00

GPU warning

This commit is contained in:
bbedward
2025-08-08 22:53:03 -04:00
parent 6b44c93547
commit e20d0be73d
3 changed files with 133 additions and 16 deletions

View File

@@ -71,6 +71,7 @@ Item {
"text": "GPU Temperature",
"description": "GPU temperature display",
"icon": "auto_awesome_mosaic",
"warning": "This widget prevents GPU power off states, which can significantly impact battery life on laptops. It is not recommended to use this on laptops with hybrid graphics.",
"enabled": true
}, {
"id": "systemTray",

View File

@@ -185,6 +185,59 @@ Column {
}
}
Item {
width: 32
height: 32
visible: modelData.id === "gpuTemp" && modelData.warning
DankIcon {
name: "warning"
size: 20
color: Theme.error
anchors.centerIn: parent
opacity: warningArea.containsMouse ? 1.0 : 0.8
}
MouseArea {
id: warningArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
}
Rectangle {
id: warningTooltip
width: warningTooltipText.contentWidth + Theme.spacingM * 2
height: warningTooltipText.contentHeight + Theme.spacingS * 2
radius: Theme.cornerRadius
color: Theme.surfaceContainer
border.color: Theme.outline
border.width: 1
visible: warningArea.containsMouse
opacity: visible ? 1 : 0
x: -width - Theme.spacingS
y: (parent.height - height) / 2
z: 100
StyledText {
id: warningTooltipText
anchors.centerIn: parent
text: modelData.warning || "Warning"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
width: 300
wrapMode: Text.WordWrap
}
Behavior on opacity {
NumberAnimation {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
Item {
width: 32
height: 32