summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-17 16:06:38 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-17 16:06:38 +1000
commit5c93d07a8e8b4c0b4cea76a5f4d259a08c1c277a (patch)
treea312e33f38e463c0ccef5c76199fbb9c18cca9f5
parentlock: refactor (diff)
downloadcaelestia-shell-5c93d07a8e8b4c0b4cea76a5f4d259a08c1c277a.tar.gz
caelestia-shell-5c93d07a8e8b4c0b4cea76a5f4d259a08c1c277a.tar.bz2
caelestia-shell-5c93d07a8e8b4c0b4cea76a5f4d259a08c1c277a.zip
internal: scale rounding properly
-rw-r--r--components/controls/CircularProgress.qml4
-rw-r--r--components/controls/StyledSwitch.qml2
-rw-r--r--modules/controlcenter/bluetooth/Details.qml2
-rw-r--r--modules/controlcenter/bluetooth/DeviceList.qml4
-rw-r--r--modules/controlcenter/bluetooth/Settings.qml2
-rw-r--r--modules/dashboard/Media.qml4
-rw-r--r--modules/dashboard/Performance.qml2
-rw-r--r--modules/dashboard/dash/Media.qml4
-rw-r--r--modules/lock/LockSurface.qml5
-rw-r--r--modules/lock/Media.qml2
10 files changed, 16 insertions, 15 deletions
diff --git a/components/controls/CircularProgress.qml b/components/controls/CircularProgress.qml
index aa0de5c..209d53b 100644
--- a/components/controls/CircularProgress.qml
+++ b/components/controls/CircularProgress.qml
@@ -26,7 +26,7 @@ Shape {
fillColor: "transparent"
strokeColor: root.bgColour
strokeWidth: root.strokeWidth
- capStyle: ShapePath.RoundCap
+ capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
PathAngleArc {
startAngle: root.startAngle + 360 * root.vValue + root.gapAngle
@@ -50,7 +50,7 @@ Shape {
fillColor: "transparent"
strokeColor: root.fgColour
strokeWidth: root.strokeWidth
- capStyle: ShapePath.RoundCap
+ capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
PathAngleArc {
startAngle: root.startAngle
diff --git a/components/controls/StyledSwitch.qml b/components/controls/StyledSwitch.qml
index c3e3957..7b23712 100644
--- a/components/controls/StyledSwitch.qml
+++ b/components/controls/StyledSwitch.qml
@@ -91,7 +91,7 @@ Switch {
strokeWidth: Appearance.font.size.larger * 0.15
strokeColor: root.checked ? Colours.palette.m3primary : Colours.palette.m3surfaceContainerHighest
fillColor: "transparent"
- capStyle: ShapePath.RoundCap
+ capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
startX: icon.start1.x
startY: icon.start1.y
diff --git a/modules/controlcenter/bluetooth/Details.qml b/modules/controlcenter/bluetooth/Details.qml
index 7a7d6c3..d3df798 100644
--- a/modules/controlcenter/bluetooth/Details.qml
+++ b/modules/controlcenter/bluetooth/Details.qml
@@ -265,7 +265,7 @@ Item {
implicitWidth: implicitHeight
implicitHeight: editIcon.implicitHeight + Appearance.padding.smaller * 2
- radius: root.session.bt.editingDeviceName ? Appearance.rounding.small : implicitHeight / 2
+ radius: root.session.bt.editingDeviceName ? Appearance.rounding.small : implicitHeight / 2 * Math.min(1, Appearance.rounding.scale)
color: Qt.alpha(Colours.palette.m3primary, root.session.bt.editingDeviceName ? 1 : 0)
StateLayer {
diff --git a/modules/controlcenter/bluetooth/DeviceList.qml b/modules/controlcenter/bluetooth/DeviceList.qml
index 3435d84..bfbfd9c 100644
--- a/modules/controlcenter/bluetooth/DeviceList.qml
+++ b/modules/controlcenter/bluetooth/DeviceList.qml
@@ -113,7 +113,7 @@ ColumnLayout {
implicitWidth: implicitHeight
implicitHeight: scanIcon.implicitHeight + Appearance.padding.normal * 2
- radius: Bluetooth.defaultAdapter?.discovering ? Appearance.rounding.normal : implicitHeight / 2
+ radius: Bluetooth.defaultAdapter?.discovering ? Appearance.rounding.normal : implicitHeight / 2 * Math.min(1, Appearance.rounding.scale)
color: Bluetooth.defaultAdapter?.discovering ? Colours.palette.m3secondary : Colours.palette.m3secondaryContainer
StateLayer {
@@ -290,7 +290,7 @@ ColumnLayout {
implicitWidth: toggleBtnInner.implicitWidth + Appearance.padding.large * 2
implicitHeight: toggleBtnIcon.implicitHeight + Appearance.padding.normal * 2
- radius: toggled || toggleStateLayer.pressed ? Appearance.rounding.small : Math.min(width, height) / 2
+ radius: toggled || toggleStateLayer.pressed ? Appearance.rounding.small : Math.min(width, height) / 2 * Math.min(1, Appearance.rounding.scale)
color: toggled ? Colours.palette[`m3${accent.toLowerCase()}`] : Colours.palette[`m3${accent.toLowerCase()}Container`]
StateLayer {
diff --git a/modules/controlcenter/bluetooth/Settings.qml b/modules/controlcenter/bluetooth/Settings.qml
index 6c51ee7..1b2511d 100644
--- a/modules/controlcenter/bluetooth/Settings.qml
+++ b/modules/controlcenter/bluetooth/Settings.qml
@@ -425,7 +425,7 @@ ColumnLayout {
implicitWidth: implicitHeight
implicitHeight: editIcon.implicitHeight + Appearance.padding.smaller * 2
- radius: root.session.bt.editingAdapterName ? Appearance.rounding.small : implicitHeight / 2
+ radius: root.session.bt.editingAdapterName ? Appearance.rounding.small : implicitHeight / 2 * Math.min(1, Appearance.rounding.scale)
color: Qt.alpha(Colours.palette.m3primary, root.session.bt.editingAdapterName ? 1 : 0)
StateLayer {
diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml
index 81a1740..f8c93c7 100644
--- a/modules/dashboard/Media.qml
+++ b/modules/dashboard/Media.qml
@@ -93,7 +93,7 @@ Item {
readonly property real cos: Math.cos(angle)
readonly property real sin: Math.sin(angle)
- capStyle: ShapePath.RoundCap
+ capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
strokeWidth: 360 / Config.dashboard.visualiserBars - Appearance.spacing.small / 4
strokeColor: Colours.palette.m3primary
@@ -231,7 +231,7 @@ Item {
implicitWidth: Math.max(playIcon.implicitWidth, playIcon.implicitHeight) + padding * 2
implicitHeight: implicitWidth
- radius: Players.active?.isPlaying ? Appearance.rounding.small : implicitHeight / 2
+ radius: Players.active?.isPlaying ? Appearance.rounding.small : implicitHeight / 2 * Math.min(1, Appearance.rounding.scale)
color: {
if (!Players.active?.canTogglePlaying)
return Qt.alpha(Colours.palette.m3onSurface, 0.1);
diff --git a/modules/dashboard/Performance.qml b/modules/dashboard/Performance.qml
index 2667a1e..68281f6 100644
--- a/modules/dashboard/Performance.qml
+++ b/modules/dashboard/Performance.qml
@@ -168,7 +168,7 @@ RowLayout {
ctx.reset();
ctx.lineWidth = res.thickness;
- ctx.lineCap = "round";
+ ctx.lineCap = Appearance.rounding.scale === 0 ? "square" : "round";
const radius = (Math.min(width, height) - ctx.lineWidth) / 2;
const cx = centerX;
diff --git a/modules/dashboard/dash/Media.qml b/modules/dashboard/dash/Media.qml
index 079df34..ada469f 100644
--- a/modules/dashboard/dash/Media.qml
+++ b/modules/dashboard/dash/Media.qml
@@ -40,7 +40,7 @@ Item {
fillColor: "transparent"
strokeColor: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2)
strokeWidth: Config.dashboard.sizes.mediaProgressThickness
- capStyle: ShapePath.RoundCap
+ capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
PathAngleArc {
centerX: cover.x + cover.width / 2
@@ -64,7 +64,7 @@ Item {
fillColor: "transparent"
strokeColor: Colours.palette.m3primary
strokeWidth: Config.dashboard.sizes.mediaProgressThickness
- capStyle: ShapePath.RoundCap
+ capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
PathAngleArc {
centerX: cover.x + cover.width / 2
diff --git a/modules/lock/LockSurface.qml b/modules/lock/LockSurface.qml
index acdc7f2..7a8535b 100644
--- a/modules/lock/LockSurface.qml
+++ b/modules/lock/LockSurface.qml
@@ -40,7 +40,7 @@ WlSessionLockSurface {
Anim {
target: lockBg
property: "radius"
- to: lockContent.size / 4
+ to: lockContent.radius
}
Anim {
target: content
@@ -183,6 +183,7 @@ WlSessionLockSurface {
id: lockContent
readonly property int size: lockIcon.implicitHeight + Appearance.padding.large * 4
+ readonly property int radius: size / 4 * Appearance.rounding.scale
anchors.centerIn: parent
implicitWidth: size
@@ -196,7 +197,7 @@ WlSessionLockSurface {
anchors.fill: parent
color: Colours.palette.m3surface
- radius: parent.size / 4
+ radius: parent.radius
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
layer.enabled: true
diff --git a/modules/lock/Media.qml b/modules/lock/Media.qml
index be289eb..59bed16 100644
--- a/modules/lock/Media.qml
+++ b/modules/lock/Media.qml
@@ -163,7 +163,7 @@ Item {
implicitHeight: controlIcon.implicitHeight + Appearance.padding.normal * 2
color: active ? Colours.palette[`m3${colour.toLowerCase()}`] : Colours.palette[`m3${colour.toLowerCase()}Container`]
- radius: active || controlState.pressed ? Appearance.rounding.normal : Math.min(implicitWidth, implicitHeight) / 2
+ radius: active || controlState.pressed ? Appearance.rounding.normal : Math.min(implicitWidth, implicitHeight) / 2 * Math.min(1, Appearance.rounding.scale)
Elevation {
anchors.fill: parent