widgets: drop tabular figures from bar and dash numerics

theme: change light mode backdrop color

port 2.0

(cherry picked from commit e4c4fe44ea)
This commit is contained in:
bbedward authored and dux-ci[bot] committed 2026-10-28 21:55:16 +00:00
1 parent c813f65581
commit 47744d34b7
39 files changed
+23 -130

No files matched your search

Generated
+3 -3
View File
@@ -3,11 +3,11 @@
"dank-qml-common": {
"flake": false,
"locked": {
"lastModified": 1793216848,
"narHash": "sha256-EpHDdsF/PZq370xCGSceSx49UqM8Hj+XTfGiBmbMfCE=",
"lastModified": 1793224384,
"narHash": "sha256-mJaCE9rdBd/HyYSCPomQM/uX+1YNmFfV64bMIdUSiL0=",
"owner": "duxlabs-dev",
"repo": "dux-qml-common",
"rev": "f1c3e1dec547b051f9490d54d89770e90a6270ba",
"rev": "09ac4aba511f10636c273e11028fe092196c78ba",
"type": "github"
},
"original": {
+1
View File
@@ -1345,6 +1345,7 @@ Singleton {
readonly property color screenOffColor: "#000000"
readonly property real scrimAlpha: 0.55
readonly property color scrimColor: currentThemeData.scrim || "#000000"
readonly property color backdropColor: surface.hslLightness >= 0.5 ? surfaceDim : scrimColor
readonly property real buttonHeightXXS: 28
readonly property real buttonHeightXS: 32
readonly property real buttonHeightS: 40
@@ -66,7 +66,7 @@ ClippingRectangle {
Rectangle {
anchors.fill: parent
color: Theme.withAlpha(Theme.scrimColor, Theme.scrimAlpha)
color: Theme.withAlpha(Theme.backdropColor, Theme.scrimAlpha)
}
MouseArea {
@@ -93,7 +93,7 @@ Item {
Rectangle {
anchors.fill: parent
color: Theme.scrimColor
color: Theme.backdropColor
opacity: root.backgroundOpacity
}
+1 -1
View File
@@ -614,7 +614,7 @@ Item {
Rectangle {
anchors.fill: parent
z: -1
color: "black"
color: Theme.backdropColor
opacity: root.useBackground ? (root.shouldBeVisible ? root.backgroundOpacity : 0) : 0
visible: root.useBackground
@@ -1236,7 +1236,7 @@ Item {
Rectangle {
id: backgroundDarken
anchors.fill: parent
color: Theme.scrimColor
color: Theme.backdropColor
opacity: root.floatingMotionVisible && root.useBackgroundDarken ? Theme.scrimAlpha : 0
visible: (root.spotlightOpen || root.isClosing) && (root.useBackgroundDarken || opacity > 0)
z: -3
@@ -405,7 +405,7 @@ FocusScope {
topRightRadius: root.surfaceCornerRadii.y
bottomRightRadius: root.surfaceCornerRadii.z
bottomLeftRadius: root.surfaceCornerRadii.w
color: Qt.rgba(0, 0, 0, Theme.scrimAlpha)
color: Theme.withAlpha(Theme.backdropColor, Theme.scrimAlpha)
opacity: root.host.powerMenuOpen ? 1 : 0
visible: opacity > 0
z: CcMetrics.overlayZ
@@ -53,7 +53,7 @@ Item {
topRightRadius: root.cornerRadii.y
bottomRightRadius: root.cornerRadii.z
bottomLeftRadius: root.cornerRadii.w
color: Theme.withAlpha(Theme.scrimColor, Theme.scrimAlpha)
color: Theme.withAlpha(Theme.backdropColor, Theme.scrimAlpha)
opacity: root.shown ? 1 : 0
Behavior on opacity {
@@ -272,11 +272,7 @@ BasePill {
}
NumericText {
isMonospace: false
text: battery.horizontalSideText
reserveText: battery.horizontalSideText.replace(/\d/g, "0")
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.barTextSize(battery.barThickness, battery.barConfig?.fontScale, battery.barConfig?.maximizeWidgetText)
color: battery.contentColor
anchors.verticalCenter: parent.verticalCenter
@@ -760,7 +760,7 @@ BasePill {
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.widgetTextColor
anchors.verticalCenter: parent.verticalCenter
width: visible ? implicitWidth : 0
width: visible ? reservedWidth : 0
}
}
}
@@ -797,7 +797,7 @@ BasePill {
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.widgetTextColor
anchors.verticalCenter: parent.verticalCenter
width: visible ? implicitWidth : 0
width: visible ? reservedWidth : 0
}
}
}
@@ -834,7 +834,7 @@ BasePill {
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.widgetTextColor
anchors.verticalCenter: parent.verticalCenter
width: visible ? implicitWidth : 0
width: visible ? reservedWidth : 0
}
}
}
@@ -36,7 +36,6 @@ MonitorPill {
widgetType: "diskUsage"
dgopModules: ["diskmounts"]
tabularDigits: false
iconName: "storage"
level: diskUsagePercent
warnLevel: 75
@@ -67,11 +67,8 @@ BasePill {
}
NumericText {
isMonospace: false
text: root.verticalLabel(root.currentLayout)
reserveText: root.widestLabel(root._allVerticalLabels, labelMetrics)
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: root.contentColor
anchors.horizontalCenter: parent.horizontalCenter
@@ -95,11 +92,8 @@ BasePill {
NumericText {
id: horizontalLabel
isMonospace: false
text: root.displayLabel(root.currentLayout)
reserveText: root.widestLabel(root._allLayoutLabels, labelMetrics)
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: root.contentColor
anchors.verticalCenter: parent.verticalCenter
@@ -20,7 +20,6 @@ BasePill {
property string horizontalText: "--"
property string reserveText: ""
property string sortKey: ""
property bool tabularDigits: true
readonly property bool minimumWidth: SettingsData.widgetOption(widgetType, widgetData, "minimumWidth")
readonly property real iconSize: Theme.barIconSize(barThickness, undefined, barConfig?.maximizeWidgetIcons, barConfig?.iconScale)
readonly property real textSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
@@ -59,10 +58,6 @@ BasePill {
}
NumericText {
isMonospace: false
font.features: root.tabularDigits ? ({
"tnum": 1
}) : ({})
text: root.verticalText
font.pixelSize: root.textSize
color: root.contentColor
@@ -70,7 +65,6 @@ BasePill {
}
NumericText {
isMonospace: false
visible: root.verticalSecondaryText !== ""
text: root.verticalSecondaryText
font.pixelSize: root.textSize
@@ -103,14 +97,8 @@ BasePill {
}
NumericText {
isMonospace: false
font.features: root.tabularDigits ? ({
"tnum": 1
}) : ({})
text: root.horizontalText
reserveText: root.minimumWidth ? root.reserveText : ""
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
font.pixelSize: root.textSize
color: root.contentColor
anchors.verticalCenter: parent.verticalCenter
@@ -82,7 +82,6 @@ BasePill {
}
NumericText {
isMonospace: false
text: root.verticalRate(DgopService.networkRxRate)
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.info
@@ -90,7 +89,6 @@ BasePill {
}
NumericText {
isMonospace: false
text: root.verticalRate(DgopService.networkTxRate)
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.error
@@ -122,10 +120,8 @@ BasePill {
}
NumericText {
isMonospace: false
text: root.horizontalRate(DgopService.networkRxRate)
reserveText: root.reserveRate
width: Math.ceil(reservedWidth)
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: root.contentColor
anchors.verticalCenter: parent.verticalCenter
@@ -145,10 +141,8 @@ BasePill {
}
NumericText {
isMonospace: false
text: root.horizontalRate(DgopService.networkTxRate)
reserveText: root.reserveRate
width: Math.ceil(reservedWidth)
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: root.contentColor
anchors.verticalCenter: parent.verticalCenter
@@ -64,11 +64,7 @@ BasePill {
}
NumericText {
isMonospace: false
text: WeatherService.currentTempText(false)
reserveText: text.replace(/\d/g, "0")
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: root.contentColor
anchors.verticalCenter: parent.verticalCenter
@@ -345,7 +345,7 @@ MediaChromeBase {
anchors.verticalCenter: parent.verticalCenter
visible: root.hasSeekbar
text: Format.formatDuration(seekbar.value * (root.presentation?.length ?? 0))
reserveText: duration.text.replace(/\d/g, "8")
reserveText: duration.text
}
MediaSeekbar {
@@ -364,7 +364,6 @@ MediaChromeBase {
anchors.verticalCenter: parent.verticalCenter
visible: root.hasSeekbar
text: Format.formatDuration(root.presentation?.length ?? 0)
reserveText: text.replace(/\d/g, "8")
}
}
}
@@ -414,8 +413,6 @@ MediaChromeBase {
}
component TimeLabel: NumericText {
width: Math.ceil(reservedWidth)
isMonospace: false
color: Theme.onSurfaceVariant
font.pixelSize: Theme.fontSizeSmall
font.weight: Theme.fontWeightMedium
@@ -115,12 +115,10 @@ MediaChromeBase {
readonly property string durationText: (root.presentation?.length ?? 0) > 0 ? Format.formatDuration(root.presentation.length) : "--:--"
width: Math.ceil(reservedWidth)
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: Format.formatDuration(Math.max(0, Math.min(root.activePlayer?.position ?? 0, root.player.stableLength || Infinity))) + " / " + durationText
reserveText: (durationText + " / " + durationText).replace(/\d/g, "8")
isMonospace: false
reserveText: durationText + " / " + durationText
color: Theme.surfaceText
font.pixelSize: Theme.fontSizeSmall
font.weight: Theme.fontWeightMedium
@@ -62,9 +62,6 @@ Card {
text: root.levelText
font.pixelSize: root.tall ? Theme.fontSizeDisplay : Theme.fontSizeXXLarge
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
color: root.contentColor
elide: Text.ElideRight
}
@@ -108,9 +105,6 @@ Card {
text: root.levelText
font.pixelSize: Theme.fontSizeXLarge
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
color: root.contentColor
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
@@ -75,9 +75,6 @@ Card {
text: root.badgeText
font.pixelSize: Theme.fontSizeMedium
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
color: root.contentColor
}
}
@@ -186,9 +183,6 @@ Card {
text: root.valueText
font.pixelSize: root.hero ? Theme.fontSizeDisplay : (root.compact ? DashMetrics.tileValueSizeCompact : Theme.fontSizeXXLarge)
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
color: root.contentColor
elide: Text.ElideRight
}
@@ -176,10 +176,8 @@ Card {
id: meterValue
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
isMonospace: false
text: root.meterText(meterRow.modelData)
reserveText: "100%"
width: Math.ceil(reservedWidth)
font.pixelSize: Theme.fontSizeMedium
font.weight: Theme.fontWeightMedium
color: root.contentColor
@@ -183,9 +183,6 @@ Card {
text: root.tempText
font.pixelSize: root.available ? Math.min(Theme.fontSizeDisplay * 1.5, stackedLayout.height * 0.32) : Theme.fontSizeMedium
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
minimumPixelSize: Theme.fontSizeXLarge
fontSizeMode: Text.HorizontalFit
color: root.contentColor
@@ -62,9 +62,6 @@ Card {
text: WellbeingService.formatDuration(root.today.active)
font.pixelSize: root.wide ? Theme.fontSizeXXLarge : DashMetrics.tileValueSizeCompact
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
color: root.overLimit ? Theme.error : root.contentColor
elide: Text.ElideRight
}
@@ -112,9 +109,6 @@ Card {
anchors.verticalCenter: parent.verticalCenter
text: WellbeingService.formatDuration(appRow.modelData.seconds)
font.pixelSize: Theme.fontSizeSmall
font.features: ({
"tnum": 1
})
color: root.mutedColor
}
}
@@ -89,9 +89,6 @@ Rectangle {
text: root.tempText
font.pixelSize: Theme.fontSizeMedium
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
color: root.foreground
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
@@ -130,9 +130,6 @@ Item {
text: WeatherService.formatTemp(root.daily ? column.modelData.tempMax : column.modelData.temp) ?? "--"
font.pixelSize: Theme.fontSizeSmall
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
color: column.current ? Theme.primary : Theme.surfaceText
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
@@ -135,9 +135,6 @@ Rectangle {
font.weight: Theme.fontWeightMedium
minimumPixelSize: Theme.fontSizeXXLarge
fontSizeMode: Text.HorizontalFit
font.features: ({
"tnum": 1
})
}
DMaterialShape {
@@ -245,9 +245,6 @@ Rectangle {
color: root.foreground
horizontalAlignment: root.leadingContent ? Text.AlignLeft : Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.features: ({
"tnum": 1
})
}
StyledText {
@@ -121,9 +121,6 @@ Rectangle {
font.weight: Theme.fontWeightMedium
color: toneColors.contentColor
elide: Text.ElideRight
font.features: ({
"tnum": 1
})
}
}
}
@@ -202,7 +202,6 @@ DCard {
anchors.right: limitButton.left
anchors.rightMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter
width: reservedWidth
horizontalAlignment: Text.AlignRight
reserveText: WellbeingService.formatDuration(10 * Wellbeing.secondsPerHour)
text: WellbeingService.formatDuration(row.modelData.seconds)
@@ -123,9 +123,6 @@ DCard {
text: WellbeingService.formatDuration(root.hoverDay ? root.hoverDay.active : root.total)
font.pixelSize: Theme.fontSizeXLarge
font.weight: Theme.fontWeightBold
font.features: ({
"tnum": 1
})
color: root.accentColor
}
@@ -164,9 +161,6 @@ DCard {
text: root.rangeText
font.pixelSize: Theme.fontSizeSmall
font.weight: Theme.fontWeightMedium
font.features: ({
"tnum": 1
})
color: root.weekOffset === 0 ? root.accentColor : root.contentColor
elide: Text.ElideRight
}
@@ -395,9 +389,6 @@ DCard {
y: root.yFor(modelData * Wellbeing.secondsPerHour) - height / 2
text: I18n.tr("%1h", "hours abbreviation, %1 is a number").arg(modelData)
font.pixelSize: Theme.fontSizeSmall
font.features: ({
"tnum": 1
})
color: root.mutedColor
}
}
+1 -1
View File
@@ -53,7 +53,7 @@ Scope {
Rectangle {
anchors.fill: parent
color: Theme.scrimColor
color: Theme.backdropColor
opacity: Theme.scrimAlpha
}
+1 -1
View File
@@ -628,7 +628,7 @@ FocusScope {
Rectangle {
anchors.fill: parent
color: Theme.withAlpha(Theme.scrimColor, Theme.scrimAlpha)
color: Theme.withAlpha(Theme.backdropColor, Theme.scrimAlpha)
opacity: dock.editMode ? 1 : 0
visible: opacity > 0
@@ -63,8 +63,6 @@ Rectangle {
NumericText {
text: root.gridSize + "px"
reserveText: "200px"
width: Math.ceil(reservedWidth)
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
@@ -162,7 +162,6 @@ Rectangle {
}
NumericText {
isMonospace: false
Layout.maximumWidth: card.width - Theme.spacingM * 2
elide: Text.ElideRight
text: card.value
@@ -94,7 +94,6 @@ DListItem {
maximumLineCount: 1
reserveText: "9999.9%"
text: (root.process?.cpu ?? 0).toFixed(1) + "%"
isMonospace: false
horizontalAlignment: Text.AlignRight
font.pixelSize: Theme.fontSizeSmall
color: root.contentColor
@@ -107,7 +106,6 @@ DListItem {
maximumLineCount: 1
reserveText: "999.9 GB"
text: Format.formatBytes((root.process?.memoryKB ?? 0) * 1024)
isMonospace: false
horizontalAlignment: Text.AlignRight
font.pixelSize: Theme.fontSizeSmall
color: root.contentColor
@@ -120,7 +118,6 @@ DListItem {
maximumLineCount: 1
reserveText: "9999999"
text: (root.process?.pid ?? 0).toString()
isMonospace: false
horizontalAlignment: Text.AlignRight
font.pixelSize: Theme.fontSizeSmall
color: root.supportingContentColor
@@ -270,7 +270,7 @@ DFloatingWindow {
Rectangle {
anchors.fill: parent
color: Theme.scrimColor
color: Theme.backdropColor
opacity: Theme.scrimAlpha
}
@@ -232,11 +232,7 @@ Item {
id: clockText
anchors.centerIn: parent
isMonospace: false
text: root.timeText
reserveText: root.timeText.replace(/\d/g, "0")
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
color: Theme.surfaceText
font.pixelSize: Theme.fontSizeSmall * root.contentScale
font.weight: Theme.fontWeightMedium
@@ -293,10 +289,8 @@ Item {
NumericText {
anchors.horizontalCenter: parent.horizontalCenter
isMonospace: false
text: root.hourText
reserveText: "00"
horizontalAlignment: Text.AlignHCenter
color: Theme.surfaceText
font.pixelSize: Theme.fontSizeSmall * root.contentScale
font.weight: Theme.fontWeightMedium
@@ -304,10 +298,8 @@ Item {
NumericText {
anchors.horizontalCenter: parent.horizontalCenter
isMonospace: false
text: root.minuteText
reserveText: "00"
horizontalAlignment: Text.AlignHCenter
color: Theme.surfaceTextMedium
font.pixelSize: Theme.fontSizeSmall * root.contentScale
font.weight: Theme.fontWeightMedium
+4 -8
View File
@@ -5,6 +5,7 @@ import QtQuick.Shapes
import Quickshell.Widgets
import qs.Common
import qs.Services
import qs.DCommon.Common
import qs.DCommon.Widgets
import qs.Widgets
@@ -99,10 +100,7 @@ Item {
font.weight: root.glyphWeight
font.pixelSize: Math.max(1, root.baseTextSize)
font.features: {
"tnum": 1
}
text: root.numberText
text: root.numberText.replace(/\d/g, Fonts.widestDigit(fitMetrics.font))
}
StyledTextMetrics {
@@ -299,9 +297,8 @@ Item {
}
NumericText {
isMonospace: false
visible: root.ringNumberVisible
x: (root.width - implicitWidth) / 2
x: (root.width - width) / 2
y: root.textBaseline - baselineOffset
text: root.numberText
color: Theme.surfaceText
@@ -382,9 +379,8 @@ Item {
height: root.height
NumericText {
isMonospace: false
visible: root.numberInside
x: root.textCanvasLeft + (root.textCanvasWidth - implicitWidth) / 2
x: root.textCanvasLeft + (root.textCanvasWidth - width) / 2
y: root.textBaseline - baselineOffset
text: root.numberText
color: glyphs.ink
-4
View File
@@ -68,10 +68,6 @@ Item {
required property int index
anchors.horizontalCenter: parent.horizontalCenter
text: stack.lines[index]
reserveText: text.replace(/\d/g, "0")
width: Math.ceil(reservedWidth)
horizontalAlignment: Text.AlignHCenter
isMonospace: false
color: stack.color
font.pixelSize: root.fontSize
}