1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-08 04:09:15 -04:00

feat(control-center): add DiskUsage widget config overlay with showMountPath toggle and standardized tile sizing (#2507)

* feat(control-center): add widget config overlay with showMountPath toggle for DiskUsage

Introduces WidgetConfigOverlay and DiskUsageWidgetConfigMenu components, allowing
users to toggle mount path visibility per DiskUsage widget in edit mode

* refactor(control-center): use Theme.iconSizeLarge and Theme.fontSizeLarge for small tiles

Standardize SmallDiskUsageButton and SmallBatteryButton sizing with Theme.iconSizeLarge
and Theme.fontSizeLarge, and unify font weight to Font.Bold on both tile widgets.

* fix(control-center): adjust SmallDiskUsageButton font size based on showMountPath

* refactor(control-center): simplify DiskUsage config menu i18n strings

Remove the redundant "Disk Usage Widget" title and the toggle description
to reduce translatable strings
This commit is contained in:
Guilherme Pagano
2026-06-01 12:35:14 -03:00
committed by GitHub
parent 12e43d120e
commit 3e4d2b4d46
12 changed files with 173 additions and 6 deletions
@@ -8,6 +8,7 @@ CompoundPill {
property string mountPath: "/"
property string instanceId: ""
property bool showMountPath: true
iconName: "storage"
@@ -37,6 +38,9 @@ CompoundPill {
if (!selectedMount) {
return I18n.tr("No disk data");
}
if (!showMountPath) {
return I18n.tr("Disk Usage");
}
return selectedMount.mount;
}
@@ -64,7 +64,7 @@ Rectangle {
DankIcon {
name: BatteryService.getBatteryIcon()
size: parent.parent.width * 0.25
size: Theme.iconSizeLarge
color: {
if (BatteryService.isLowBattery && !BatteryService.isCharging) {
return Theme.error;
@@ -76,8 +76,8 @@ Rectangle {
StyledText {
text: BatteryService.batteryAvailable ? `${BatteryService.batteryLevel}%` : ""
font.pixelSize: parent.parent.width * 0.15
font.weight: Font.Medium
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Bold
color: {
if (BatteryService.isLowBattery && !BatteryService.isCharging) {
return Theme.error;
@@ -11,6 +11,7 @@ Rectangle {
property string mountPath: "/"
property string instanceId: ""
property bool showMountPath: true
property var selectedMount: {
if (!DgopService.diskMounts || DgopService.diskMounts.length === 0)
@@ -67,7 +68,7 @@ Rectangle {
DankIcon {
anchors.verticalCenter: parent.verticalCenter
name: "storage"
size: Theme.iconSizeSmall
size: Theme.iconSizeLarge
color: {
if (root.usagePercent > 90)
return Theme.error;
@@ -82,6 +83,7 @@ Rectangle {
spacing: 0
StyledText {
visible: root.showMountPath
text: root.selectedMount?.mount || root.mountPath
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
@@ -92,7 +94,7 @@ Rectangle {
StyledText {
text: `${root.usagePercent.toFixed(0)}%`
font.pixelSize: Theme.fontSizeSmall
font.pixelSize: root.showMountPath ? Theme.fontSizeSmall : Theme.fontSizeLarge
font.weight: Font.Bold
color: {
if (root.usagePercent > 90)