internal: scale rounding properly
This commit is contained in:
parent
53bfe29a40
commit
5c93d07a8e
10 changed files with 16 additions and 15 deletions
|
|
@ -26,7 +26,7 @@ Shape {
|
||||||
fillColor: "transparent"
|
fillColor: "transparent"
|
||||||
strokeColor: root.bgColour
|
strokeColor: root.bgColour
|
||||||
strokeWidth: root.strokeWidth
|
strokeWidth: root.strokeWidth
|
||||||
capStyle: ShapePath.RoundCap
|
capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
|
||||||
|
|
||||||
PathAngleArc {
|
PathAngleArc {
|
||||||
startAngle: root.startAngle + 360 * root.vValue + root.gapAngle
|
startAngle: root.startAngle + 360 * root.vValue + root.gapAngle
|
||||||
|
|
@ -50,7 +50,7 @@ Shape {
|
||||||
fillColor: "transparent"
|
fillColor: "transparent"
|
||||||
strokeColor: root.fgColour
|
strokeColor: root.fgColour
|
||||||
strokeWidth: root.strokeWidth
|
strokeWidth: root.strokeWidth
|
||||||
capStyle: ShapePath.RoundCap
|
capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
|
||||||
|
|
||||||
PathAngleArc {
|
PathAngleArc {
|
||||||
startAngle: root.startAngle
|
startAngle: root.startAngle
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ Switch {
|
||||||
strokeWidth: Appearance.font.size.larger * 0.15
|
strokeWidth: Appearance.font.size.larger * 0.15
|
||||||
strokeColor: root.checked ? Colours.palette.m3primary : Colours.palette.m3surfaceContainerHighest
|
strokeColor: root.checked ? Colours.palette.m3primary : Colours.palette.m3surfaceContainerHighest
|
||||||
fillColor: "transparent"
|
fillColor: "transparent"
|
||||||
capStyle: ShapePath.RoundCap
|
capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
|
||||||
|
|
||||||
startX: icon.start1.x
|
startX: icon.start1.x
|
||||||
startY: icon.start1.y
|
startY: icon.start1.y
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ Item {
|
||||||
implicitWidth: implicitHeight
|
implicitWidth: implicitHeight
|
||||||
implicitHeight: editIcon.implicitHeight + Appearance.padding.smaller * 2
|
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)
|
color: Qt.alpha(Colours.palette.m3primary, root.session.bt.editingDeviceName ? 1 : 0)
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ ColumnLayout {
|
||||||
implicitWidth: implicitHeight
|
implicitWidth: implicitHeight
|
||||||
implicitHeight: scanIcon.implicitHeight + Appearance.padding.normal * 2
|
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
|
color: Bluetooth.defaultAdapter?.discovering ? Colours.palette.m3secondary : Colours.palette.m3secondaryContainer
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
|
|
@ -290,7 +290,7 @@ ColumnLayout {
|
||||||
implicitWidth: toggleBtnInner.implicitWidth + Appearance.padding.large * 2
|
implicitWidth: toggleBtnInner.implicitWidth + Appearance.padding.large * 2
|
||||||
implicitHeight: toggleBtnIcon.implicitHeight + Appearance.padding.normal * 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`]
|
color: toggled ? Colours.palette[`m3${accent.toLowerCase()}`] : Colours.palette[`m3${accent.toLowerCase()}Container`]
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ ColumnLayout {
|
||||||
implicitWidth: implicitHeight
|
implicitWidth: implicitHeight
|
||||||
implicitHeight: editIcon.implicitHeight + Appearance.padding.smaller * 2
|
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)
|
color: Qt.alpha(Colours.palette.m3primary, root.session.bt.editingAdapterName ? 1 : 0)
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ Item {
|
||||||
readonly property real cos: Math.cos(angle)
|
readonly property real cos: Math.cos(angle)
|
||||||
readonly property real sin: Math.sin(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
|
strokeWidth: 360 / Config.dashboard.visualiserBars - Appearance.spacing.small / 4
|
||||||
strokeColor: Colours.palette.m3primary
|
strokeColor: Colours.palette.m3primary
|
||||||
|
|
||||||
|
|
@ -231,7 +231,7 @@ Item {
|
||||||
implicitWidth: Math.max(playIcon.implicitWidth, playIcon.implicitHeight) + padding * 2
|
implicitWidth: Math.max(playIcon.implicitWidth, playIcon.implicitHeight) + padding * 2
|
||||||
implicitHeight: implicitWidth
|
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: {
|
color: {
|
||||||
if (!Players.active?.canTogglePlaying)
|
if (!Players.active?.canTogglePlaying)
|
||||||
return Qt.alpha(Colours.palette.m3onSurface, 0.1);
|
return Qt.alpha(Colours.palette.m3onSurface, 0.1);
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ RowLayout {
|
||||||
ctx.reset();
|
ctx.reset();
|
||||||
|
|
||||||
ctx.lineWidth = res.thickness;
|
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 radius = (Math.min(width, height) - ctx.lineWidth) / 2;
|
||||||
const cx = centerX;
|
const cx = centerX;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ Item {
|
||||||
fillColor: "transparent"
|
fillColor: "transparent"
|
||||||
strokeColor: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2)
|
strokeColor: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2)
|
||||||
strokeWidth: Config.dashboard.sizes.mediaProgressThickness
|
strokeWidth: Config.dashboard.sizes.mediaProgressThickness
|
||||||
capStyle: ShapePath.RoundCap
|
capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
|
||||||
|
|
||||||
PathAngleArc {
|
PathAngleArc {
|
||||||
centerX: cover.x + cover.width / 2
|
centerX: cover.x + cover.width / 2
|
||||||
|
|
@ -64,7 +64,7 @@ Item {
|
||||||
fillColor: "transparent"
|
fillColor: "transparent"
|
||||||
strokeColor: Colours.palette.m3primary
|
strokeColor: Colours.palette.m3primary
|
||||||
strokeWidth: Config.dashboard.sizes.mediaProgressThickness
|
strokeWidth: Config.dashboard.sizes.mediaProgressThickness
|
||||||
capStyle: ShapePath.RoundCap
|
capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
|
||||||
|
|
||||||
PathAngleArc {
|
PathAngleArc {
|
||||||
centerX: cover.x + cover.width / 2
|
centerX: cover.x + cover.width / 2
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ WlSessionLockSurface {
|
||||||
Anim {
|
Anim {
|
||||||
target: lockBg
|
target: lockBg
|
||||||
property: "radius"
|
property: "radius"
|
||||||
to: lockContent.size / 4
|
to: lockContent.radius
|
||||||
}
|
}
|
||||||
Anim {
|
Anim {
|
||||||
target: content
|
target: content
|
||||||
|
|
@ -183,6 +183,7 @@ WlSessionLockSurface {
|
||||||
id: lockContent
|
id: lockContent
|
||||||
|
|
||||||
readonly property int size: lockIcon.implicitHeight + Appearance.padding.large * 4
|
readonly property int size: lockIcon.implicitHeight + Appearance.padding.large * 4
|
||||||
|
readonly property int radius: size / 4 * Appearance.rounding.scale
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
implicitWidth: size
|
implicitWidth: size
|
||||||
|
|
@ -196,7 +197,7 @@ WlSessionLockSurface {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Colours.palette.m3surface
|
color: Colours.palette.m3surface
|
||||||
radius: parent.size / 4
|
radius: parent.radius
|
||||||
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
|
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ Item {
|
||||||
implicitHeight: controlIcon.implicitHeight + Appearance.padding.normal * 2
|
implicitHeight: controlIcon.implicitHeight + Appearance.padding.normal * 2
|
||||||
|
|
||||||
color: active ? Colours.palette[`m3${colour.toLowerCase()}`] : Colours.palette[`m3${colour.toLowerCase()}Container`]
|
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 {
|
Elevation {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue