mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-26 22:42:50 -05:00
GPU warning
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user