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

scaling: snap value reported by wlr-output

This commit is contained in:
bbedward
2025-11-16 15:56:59 -05:00
parent ea9b0d2a79
commit f2deaeccdb
4 changed files with 12 additions and 23 deletions

View File

@@ -455,10 +455,10 @@ Singleton {
property real spacingM: 12 property real spacingM: 12
property real spacingL: 16 property real spacingL: 16
property real spacingXL: 24 property real spacingXL: 24
property real fontSizeSmall: fontScale * 12 property real fontSizeSmall: Math.round(fontScale * 12)
property real fontSizeMedium: fontScale * 14 property real fontSizeMedium: Math.round(fontScale * 14)
property real fontSizeLarge: fontScale * 16 property real fontSizeLarge: Math.round(fontScale * 16)
property real fontSizeXLarge: fontScale * 20 property real fontSizeXLarge: Math.round(fontScale * 20)
property real barHeight: 48 property real barHeight: 48
property real iconSize: 24 property real iconSize: 24
property real iconSizeSmall: 16 property real iconSizeSmall: 16
@@ -679,10 +679,10 @@ Singleton {
const scale = barThickness / 48 const scale = barThickness / 48
const dankBarScale = (typeof SettingsData !== "undefined" ? SettingsData.dankBarFontScale : 1.0) const dankBarScale = (typeof SettingsData !== "undefined" ? SettingsData.dankBarFontScale : 1.0)
if (scale <= 0.75) if (scale <= 0.75)
return fontSizeSmall * 0.9 * dankBarScale return Math.round(fontSizeSmall * 0.9 * dankBarScale)
if (scale >= 1.25) if (scale >= 1.25)
return fontSizeMedium * dankBarScale return Math.round(fontSizeMedium * dankBarScale)
return fontSizeSmall * dankBarScale return Math.round(fontSizeSmall * dankBarScale)
} }
function getBatteryIcon(level, isCharging, batteryAvailable) { function getBatteryIcon(level, isCharging, batteryAvailable) {

View File

@@ -19,7 +19,7 @@ BasePill {
id: clockColumn id: clockColumn
visible: root.isVerticalOrientation visible: root.isVerticalOrientation
anchors.centerIn: parent anchors.centerIn: parent
spacing: -2 spacing: 0
Row { Row {
spacing: 0 spacing: 0
@@ -37,7 +37,6 @@ BasePill {
} }
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.surfaceText color: Theme.surfaceText
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
@@ -54,7 +53,6 @@ BasePill {
} }
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.surfaceText color: Theme.surfaceText
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
@@ -68,7 +66,6 @@ BasePill {
text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(0) text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(0)
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.surfaceText color: Theme.surfaceText
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
@@ -77,7 +74,6 @@ BasePill {
text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(1) text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(1)
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.surfaceText color: Theme.surfaceText
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
@@ -92,7 +88,6 @@ BasePill {
text: String(systemClock?.date?.getSeconds()).padStart(2, '0').charAt(0) text: String(systemClock?.date?.getSeconds()).padStart(2, '0').charAt(0)
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.surfaceText color: Theme.surfaceText
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
@@ -101,19 +96,18 @@ BasePill {
text: String(systemClock?.date?.getSeconds()).padStart(2, '0').charAt(1) text: String(systemClock?.date?.getSeconds()).padStart(2, '0').charAt(1)
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.surfaceText color: Theme.surfaceText
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
} }
Item { Item {
width: 12 width: parent.width
height: Theme.spacingM height: Theme.spacingM
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Rectangle { Rectangle {
width: 12 width: parent.width * 0.6
height: 1 height: 1
color: Theme.outlineButton color: Theme.outlineButton
anchors.centerIn: parent anchors.centerIn: parent
@@ -134,7 +128,6 @@ BasePill {
} }
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.primary color: Theme.primary
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
@@ -149,7 +142,6 @@ BasePill {
} }
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.primary color: Theme.primary
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
@@ -169,7 +161,6 @@ BasePill {
} }
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.primary color: Theme.primary
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
@@ -184,7 +175,6 @@ BasePill {
} }
font.pixelSize: Theme.barTextSize(root.barThickness) font.pixelSize: Theme.barTextSize(root.barThickness)
color: Theme.primary color: Theme.primary
width: 9
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }

View File

@@ -38,7 +38,7 @@ Singleton {
if (WlrOutputService.wlrOutputAvailable && screen) { if (WlrOutputService.wlrOutputAvailable && screen) {
const wlrOutput = WlrOutputService.getOutput(screen.name) const wlrOutput = WlrOutputService.getOutput(screen.name)
if (wlrOutput?.enabled && wlrOutput.scale !== undefined && wlrOutput.scale > 0) { if (wlrOutput?.enabled && wlrOutput.scale !== undefined && wlrOutput.scale > 0) {
return wlrOutput.scale return Math.round(wlrOutput.scale * 20) / 20
} }
} }

View File

@@ -38,8 +38,7 @@ Text {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
elide: Text.ElideRight elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
antialiasing: true //renderType: Text.NativeRendering
renderType: Text.NativeRendering
Behavior on opacity { Behavior on opacity {
NumberAnimation { NumberAnimation {