diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/bar/popouts/Bluetooth.qml | 13 | ||||
| -rw-r--r-- | modules/bar/popouts/Network.qml | 13 | ||||
| -rw-r--r-- | modules/controlcenter/bluetooth/DeviceList.qml | 15 | ||||
| -rw-r--r-- | modules/lock/Resources.qml | 67 |
4 files changed, 17 insertions, 91 deletions
diff --git a/modules/bar/popouts/Bluetooth.qml b/modules/bar/popouts/Bluetooth.qml index 6678030..22bdc77 100644 --- a/modules/bar/popouts/Bluetooth.qml +++ b/modules/bar/popouts/Bluetooth.qml @@ -111,17 +111,8 @@ ColumnLayout { color: Qt.alpha(Colours.palette.m3primary, device.modelData.state === BluetoothDeviceState.Connected ? 1 : 0) StyledBusyIndicator { - anchors.centerIn: parent - - implicitWidth: implicitHeight - implicitHeight: connectIcon.implicitHeight - - running: opacity > 0 - opacity: device.loading ? 1 : 0 - - Behavior on opacity { - Anim {} - } + anchors.fill: parent + running: device.loading } StateLayer { diff --git a/modules/bar/popouts/Network.qml b/modules/bar/popouts/Network.qml index 6a95b73..966823e 100644 --- a/modules/bar/popouts/Network.qml +++ b/modules/bar/popouts/Network.qml @@ -105,17 +105,8 @@ ColumnLayout { color: Qt.alpha(Colours.palette.m3primary, networkItem.modelData.active ? 1 : 0) StyledBusyIndicator { - anchors.centerIn: parent - - implicitWidth: implicitHeight - implicitHeight: connectIcon.implicitHeight - - running: opacity > 0 - opacity: networkItem.loading ? 1 : 0 - - Behavior on opacity { - Anim {} - } + anchors.fill: parent + running: networkItem.loading } StateLayer { diff --git a/modules/controlcenter/bluetooth/DeviceList.qml b/modules/controlcenter/bluetooth/DeviceList.qml index a1644e5..3435d84 100644 --- a/modules/controlcenter/bluetooth/DeviceList.qml +++ b/modules/controlcenter/bluetooth/DeviceList.qml @@ -237,23 +237,14 @@ ColumnLayout { id: connectBtn implicitWidth: implicitHeight - implicitHeight: connectIcon.implicitHeight + Appearance.padding.small * 2 + implicitHeight: connectIcon.implicitHeight + Appearance.padding.smaller * 2 radius: Appearance.rounding.full color: Qt.alpha(Colours.palette.m3primaryContainer, device.connected ? 1 : 0) StyledBusyIndicator { - anchors.centerIn: parent - - implicitWidth: implicitHeight - implicitHeight: connectIcon.implicitHeight - - running: opacity > 0 - opacity: device.loading ? 1 : 0 - - Behavior on opacity { - Anim {} - } + anchors.fill: parent + running: device.loading } StateLayer { diff --git a/modules/lock/Resources.qml b/modules/lock/Resources.qml index 0ba0188..8ff1708 100644 --- a/modules/lock/Resources.qml +++ b/modules/lock/Resources.qml @@ -1,4 +1,5 @@ import qs.components +import qs.components.controls import qs.components.misc import qs.services import qs.config @@ -57,69 +58,21 @@ GridLayout { required property real value required property color colour - readonly property int thickness: width < 200 ? Appearance.padding.smaller : Appearance.padding.normal - readonly property real arcRadius: (width - Appearance.padding.large * 3 - thickness) / 2 - readonly property real vValue: value || 1 / 360 - readonly property real gapAngle: ((Appearance.spacing.small + thickness) / (arcRadius || 1)) * (180 / Math.PI) - Layout.fillWidth: true implicitHeight: width color: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2) radius: Appearance.rounding.large - Shape { - anchors.fill: parent - preferredRendererType: Shape.CurveRenderer - asynchronous: true - - ShapePath { - fillColor: "transparent" - strokeColor: Colours.layer(Colours.palette.m3surfaceContainerHighest, 3) - strokeWidth: res.thickness - capStyle: ShapePath.RoundCap - - PathAngleArc { - startAngle: -90 + 360 * res.vValue + res.gapAngle - sweepAngle: 360 * (1 - res.vValue) - res.gapAngle * 2 - radiusX: res.arcRadius - radiusY: res.arcRadius - centerX: res.width / 2 - centerY: res.width / 2 - } - - Behavior on strokeColor { - ColorAnimation { - duration: Appearance.anim.durations.large - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } - } - } - - ShapePath { - fillColor: "transparent" - strokeColor: res.colour - strokeWidth: res.thickness - capStyle: ShapePath.RoundCap - - PathAngleArc { - startAngle: -90 - sweepAngle: 360 * res.vValue - radiusX: res.arcRadius - radiusY: res.arcRadius - centerX: res.width / 2 - centerY: res.width / 2 - } + CircularProgress { + id: circ - Behavior on strokeColor { - ColorAnimation { - duration: Appearance.anim.durations.large - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } - } - } + anchors.fill: parent + value: res.value + padding: Appearance.padding.large * 3 + fgColour: res.colour + bgColour: Colours.layer(Colours.palette.m3surfaceContainerHighest, 3) + strokeWidth: width < 200 ? Appearance.padding.smaller : Appearance.padding.normal } MaterialIcon { @@ -128,7 +81,7 @@ GridLayout { anchors.centerIn: parent text: res.icon color: res.colour - font.pointSize: (res.arcRadius * 0.7) || 1 + font.pointSize: (circ.arcRadius * 0.7) || 1 font.weight: 600 } |