Add toasts & tooltips to a lot of things, add Disk Usage

This commit is contained in:
Ly-sec 2025-09-09 13:08:48 +02:00
parent fdfe9ea2e1
commit 94d64a91b8
12 changed files with 102 additions and 6 deletions

View file

@ -85,7 +85,8 @@ Item {
id: pill
rightOpen: BarWidgetRegistry.getNPillDirection(root)
icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent, charging, isReady)
icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent,
charging, isReady)
text: (isReady || testMode) ? Math.round(percent) + "%" : "-"
autoHide: false
forceOpen: isReady && (testMode || battery.isLaptopBattery) && alwaysShowPercentage

View file

@ -38,6 +38,9 @@ RowLayout {
!== undefined) ? widgetSettings.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent
readonly property bool showNetworkStats: (widgetSettings.showNetworkStats
!== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats
readonly property bool showDiskUsage: (widgetSettings.showDiskUsage
!== undefined) ? widgetSettings.showDiskUsage : (widgetMetadata.showDiskUsage
|| false)
Layout.alignment: Qt.AlignVCenter
spacing: Style.marginS * scaling
@ -206,6 +209,36 @@ RowLayout {
}
}
}
// Disk Usage Component (primary drive)
Item {
Layout.preferredWidth: diskUsageRow.implicitWidth
Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling)
Layout.alignment: Qt.AlignVCenter
visible: showDiskUsage
RowLayout {
id: diskUsageRow
anchors.centerIn: parent
spacing: Style.marginXS * scaling
NIcon {
icon: "hdd"
font.pointSize: Style.fontSizeM * scaling
Layout.alignment: Qt.AlignVCenter
}
NText {
text: `${SystemStatService.diskPercent}%`
font.family: Settings.data.ui.fontFixed
font.pointSize: Style.fontSizeS * scaling
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignVCenter
verticalAlignment: Text.AlignVCenter
color: Color.mPrimary
}
}
}
}
}
}

View file

@ -45,7 +45,7 @@ Item {
if (AudioService.muted) {
return "volume-mute"
}
return AudioService.volume <= 0.2? "volume-off" : (AudioService.volume < 0.6 ? "volume-down" : "volume-up")
return AudioService.volume <= 0.2 ? "volume-off" : (AudioService.volume < 0.6 ? "volume-down" : "volume-up")
}
// Connection used to open the pill when volume changes