diff --git a/Modules/ControlCenter/Components/WidgetGrid.qml b/Modules/ControlCenter/Components/WidgetGrid.qml index 3446b78a..86a8a45c 100644 --- a/Modules/ControlCenter/Components/WidgetGrid.qml +++ b/Modules/ControlCenter/Components/WidgetGrid.qml @@ -178,21 +178,6 @@ Column { if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) { return "bluetooth_disabled" } - const primaryDevice = (() => { - if (!BluetoothService.adapter || !BluetoothService.adapter.devices) { - return null - } - let devices = [...BluetoothService.adapter.devices.values.filter(dev => dev && (dev.paired || dev.trusted))] - for (let device of devices) { - if (device && device.connected) { - return device - } - } - return null - })() - if (primaryDevice) { - return BluetoothService.getDeviceIcon(primaryDevice) - } return "bluetooth" } case "audioOutput": { diff --git a/Modules/ControlCenter/Details/AudioInputDetail.qml b/Modules/ControlCenter/Details/AudioInputDetail.qml index 6619c7e1..b2208196 100644 --- a/Modules/ControlCenter/Details/AudioInputDetail.qml +++ b/Modules/ControlCenter/Details/AudioInputDetail.qml @@ -57,10 +57,6 @@ Rectangle { radius: (Theme.iconSize + Theme.spacingS * 2) / 2 color: iconArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent" - Behavior on color { - ColorAnimation { duration: Theme.shortDuration } - } - MouseArea { id: iconArea anchors.fill: parent @@ -138,9 +134,9 @@ Rectangle { width: parent.width height: 50 radius: Theme.cornerRadius - color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHigh + color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest border.color: modelData === AudioService.source ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12) - border.width: modelData === AudioService.source ? 2 : 1 + border.width: 0 Row { anchors.left: parent.left @@ -198,14 +194,6 @@ Rectangle { } } } - - Behavior on color { - ColorAnimation { duration: Theme.shortDuration } - } - - Behavior on border.color { - ColorAnimation { duration: Theme.shortDuration } - } } } } diff --git a/Modules/ControlCenter/Details/AudioOutputDetail.qml b/Modules/ControlCenter/Details/AudioOutputDetail.qml index f66b3b66..154d55df 100644 --- a/Modules/ControlCenter/Details/AudioOutputDetail.qml +++ b/Modules/ControlCenter/Details/AudioOutputDetail.qml @@ -57,10 +57,6 @@ Rectangle { radius: (Theme.iconSize + Theme.spacingS * 2) / 2 color: iconArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent" - Behavior on color { - ColorAnimation { duration: Theme.shortDuration } - } - MouseArea { id: iconArea anchors.fill: parent @@ -143,9 +139,9 @@ Rectangle { width: parent.width height: 50 radius: Theme.cornerRadius - color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHigh + color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest border.color: modelData === AudioService.sink ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12) - border.width: modelData === AudioService.sink ? 2 : 1 + border.width: 0 Row { anchors.left: parent.left @@ -205,14 +201,6 @@ Rectangle { } } } - - Behavior on color { - ColorAnimation { duration: Theme.shortDuration } - } - - Behavior on border.color { - ColorAnimation { duration: Theme.shortDuration } - } } } } diff --git a/Modules/ControlCenter/Details/BluetoothCodecSelector.qml b/Modules/ControlCenter/Details/BluetoothCodecSelector.qml index 7d42f91a..419fd651 100644 --- a/Modules/ControlCenter/Details/BluetoothCodecSelector.qml +++ b/Modules/ControlCenter/Details/BluetoothCodecSelector.qml @@ -206,7 +206,7 @@ Item { radius: Theme.cornerRadius color: { if (modelData.name === currentCodec) - return Theme.surfaceContainerHigh; + return Theme.surfaceContainerHighest; else if (codecMouseArea.containsMouse) return Theme.surfaceHover; else @@ -272,12 +272,6 @@ Item { } } - Behavior on color { - ColorAnimation { - duration: Theme.shortDuration - } - - } } diff --git a/Modules/ControlCenter/Details/BluetoothDetail.qml b/Modules/ControlCenter/Details/BluetoothDetail.qml index 9dc44925..f676e0c7 100644 --- a/Modules/ControlCenter/Details/BluetoothDetail.qml +++ b/Modules/ControlCenter/Details/BluetoothDetail.qml @@ -96,13 +96,6 @@ Rectangle { BluetoothService.adapter.discovering = !BluetoothService.adapter.discovering } } - - Behavior on color { - ColorAnimation { - duration: Theme.shortDuration - easing.type: Theme.standardEasing - } - } } } @@ -159,7 +152,7 @@ Rectangle { return Qt.rgba(Theme.warning.r, Theme.warning.g, Theme.warning.b, 0.12) if (deviceMouseArea.containsMouse) return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) - return Theme.surfaceContainerHigh + return Theme.surfaceContainerHighest } border.color: { if (modelData.state === BluetoothDeviceState.Connecting) @@ -168,7 +161,7 @@ Rectangle { return Theme.primary return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12) } - border.width: (modelData.connected || modelData.state === BluetoothDeviceState.Connecting) ? 2 : 1 + border.width: 0 Row { anchors.left: parent.left @@ -284,14 +277,6 @@ Rectangle { } } } - - Behavior on color { - ColorAnimation { duration: Theme.shortDuration } - } - - Behavior on border.color { - ColorAnimation { duration: Theme.shortDuration } - } } } @@ -347,7 +332,7 @@ Rectangle { width: parent.width height: 50 radius: Theme.cornerRadius - color: availableMouseArea.containsMouse && !isBusy ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHigh + color: availableMouseArea.containsMouse && !isBusy ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12) border.width: 0 opacity: canConnect ? 1 : 0.6 @@ -427,9 +412,6 @@ Rectangle { } } - Behavior on color { - ColorAnimation { duration: Theme.shortDuration } - } } } diff --git a/Modules/ControlCenter/Details/DiskUsageDetail.qml b/Modules/ControlCenter/Details/DiskUsageDetail.qml index 94689a0f..354f5964 100644 --- a/Modules/ControlCenter/Details/DiskUsageDetail.qml +++ b/Modules/ControlCenter/Details/DiskUsageDetail.qml @@ -6,6 +6,8 @@ import qs.Services import qs.Widgets Rectangle { + id: root + property string currentMountPath: "/" property string instanceId: "" @@ -76,9 +78,9 @@ Rectangle { width: parent.width height: 80 radius: Theme.cornerRadius - color: Theme.surfaceContainerHigh + color: Theme.surfaceContainerHighest border.color: modelData.mount === currentMountPath ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12) - border.width: modelData.mount === currentMountPath ? 2 : 1 + border.width: modelData.mount === currentMountPath ? 2 : 0 Row { anchors.left: parent.left @@ -152,16 +154,11 @@ Rectangle { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { - if (modelData.mount !== currentMountPath) { - currentMountPath = modelData.mount - mountPathChanged(modelData.mount) - } + currentMountPath = modelData.mount + mountPathChanged(modelData.mount) } } - Behavior on border.color { - ColorAnimation { duration: Theme.shortDuration } - } } } } diff --git a/Modules/ControlCenter/Details/NetworkDetail.qml b/Modules/ControlCenter/Details/NetworkDetail.qml index a7aa07bc..0c3618d4 100644 --- a/Modules/ControlCenter/Details/NetworkDetail.qml +++ b/Modules/ControlCenter/Details/NetworkDetail.qml @@ -27,20 +27,11 @@ Rectangle { NetworkService.scanWifi() } } - + Component.onDestruction: { NetworkService.removeRef() } - property var wifiPasswordModalRef: { - wifiPasswordModalLoader.active = true - return wifiPasswordModalLoader.item - } - property var networkInfoModalRef: { - networkInfoModalLoader.active = true - return networkInfoModalLoader.item - } - Row { id: headerRow anchors.left: parent.left @@ -177,12 +168,6 @@ Rectangle { onClicked: NetworkService.toggleWifiRadio() } - Behavior on color { - ColorAnimation { - duration: Theme.shortDuration - easing.type: Theme.standardEasing - } - } } } } @@ -242,9 +227,9 @@ Rectangle { width: parent.width height: 50 radius: Theme.cornerRadius - color: networkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHigh + color: networkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest border.color: modelData.ssid === NetworkService.currentWifiSSID ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12) - border.width: modelData.ssid === NetworkService.currentWifiSSID ? 2 : 1 + border.width: 0 Row { anchors.left: parent.left @@ -332,9 +317,7 @@ Rectangle { onClicked: function(event) { if (modelData.ssid !== NetworkService.currentWifiSSID) { if (modelData.secured && !modelData.saved) { - if (wifiPasswordModalRef) { - wifiPasswordModalRef.show(modelData.ssid) - } + wifiPasswordModal.show(modelData.ssid) } else { NetworkService.connectToWifi(modelData.ssid) } @@ -343,13 +326,6 @@ Rectangle { } } - Behavior on color { - ColorAnimation { duration: Theme.shortDuration } - } - - Behavior on border.color { - ColorAnimation { duration: Theme.shortDuration } - } } } } @@ -395,9 +371,7 @@ Rectangle { NetworkService.disconnectWifi() } else { if (networkContextMenu.currentSecured && !networkContextMenu.currentSaved) { - if (wifiPasswordModalRef) { - wifiPasswordModalRef.show(networkContextMenu.currentSSID) - } + wifiPasswordModal.show(networkContextMenu.currentSSID) } else { NetworkService.connectToWifi(networkContextMenu.currentSSID) } @@ -423,10 +397,8 @@ Rectangle { } onTriggered: { - if (networkInfoModalRef) { - let networkData = NetworkService.getNetworkInfo(networkContextMenu.currentSSID) - networkInfoModalRef.showNetworkInfo(networkContextMenu.currentSSID, networkData) - } + let networkData = NetworkService.getNetworkInfo(networkContextMenu.currentSSID) + networkInfoModal.showNetworkInfo(networkContextMenu.currentSSID, networkData) } } @@ -454,22 +426,12 @@ Rectangle { } } - LazyLoader { - id: wifiPasswordModalLoader - active: false - - WifiPasswordModal { - id: wifiPasswordModal - } + WifiPasswordModal { + id: wifiPasswordModal } - - LazyLoader { - id: networkInfoModalLoader - active: false - - NetworkInfoModal { - id: networkInfoModal - } + + NetworkInfoModal { + id: networkInfoModal } diff --git a/Modules/ControlCenter/Widgets/BluetoothPill.qml b/Modules/ControlCenter/Widgets/BluetoothPill.qml index 99f17174..34441e14 100644 --- a/Modules/ControlCenter/Widgets/BluetoothPill.qml +++ b/Modules/ControlCenter/Widgets/BluetoothPill.qml @@ -30,9 +30,6 @@ CompoundPill { if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) { return "bluetooth_disabled" } - if (primaryDevice) { - return BluetoothService.getDeviceIcon(primaryDevice) - } return "bluetooth" } diff --git a/Modules/ControlCenter/Widgets/CompoundPill.qml b/Modules/ControlCenter/Widgets/CompoundPill.qml index bd729c2f..029a0b72 100644 --- a/Modules/ControlCenter/Widgets/CompoundPill.qml +++ b/Modules/ControlCenter/Widgets/CompoundPill.qml @@ -29,7 +29,10 @@ Rectangle { readonly property color _containerBg: Theme.surfaceContainerHigh - color: _containerBg + color: { + const baseColor = bodyMouse.containsMouse ? Theme.widgetBaseHoverColor : _containerBg + return baseColor + } border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.10) border.width: 0 antialiasing: true diff --git a/Modules/ControlCenter/Widgets/SmallBatteryButton.qml b/Modules/ControlCenter/Widgets/SmallBatteryButton.qml index 6d844574..ce76ccc1 100644 --- a/Modules/ControlCenter/Widgets/SmallBatteryButton.qml +++ b/Modules/ControlCenter/Widgets/SmallBatteryButton.qml @@ -31,7 +31,11 @@ Rectangle { readonly property color _tileIconActive: Theme.primaryContainer readonly property color _tileIconInactive: Theme.primary - color: isActive ? _tileBgActive : _tileBgInactive + color: { + if (isActive) return _tileBgActive + const baseColor = mouseArea.containsMouse ? Theme.widgetBaseHoverColor : _tileBgInactive + return baseColor + } border.color: isActive ? _tileRingActive : "transparent" border.width: isActive ? 1 : 0 antialiasing: true diff --git a/Modules/ControlCenter/Widgets/SmallToggleButton.qml b/Modules/ControlCenter/Widgets/SmallToggleButton.qml index 40fd111a..d2a389a2 100644 --- a/Modules/ControlCenter/Widgets/SmallToggleButton.qml +++ b/Modules/ControlCenter/Widgets/SmallToggleButton.qml @@ -32,7 +32,11 @@ Rectangle { readonly property color _tileIconActive: Theme.primaryContainer readonly property color _tileIconInactive: Theme.primary - color: isActive ? _tileBgActive : _tileBgInactive + color: { + if (isActive) return _tileBgActive + const baseColor = mouseArea.containsMouse ? Theme.widgetBaseHoverColor : _tileBgInactive + return baseColor + } border.color: isActive ? _tileRingActive : "transparent" border.width: isActive ? 1 : 0 antialiasing: true diff --git a/Modules/ControlCenter/Widgets/ToggleButton.qml b/Modules/ControlCenter/Widgets/ToggleButton.qml index a2832818..f48aa046 100644 --- a/Modules/ControlCenter/Widgets/ToggleButton.qml +++ b/Modules/ControlCenter/Widgets/ToggleButton.qml @@ -27,7 +27,11 @@ Rectangle { readonly property color _tileRingActive: Qt.rgba(Theme.primaryText.r, Theme.primaryText.g, Theme.primaryText.b, 0.22) - color: isActive ? _tileBgActive : _tileBgInactive + color: { + if (isActive) return _tileBgActive + const baseColor = mouseArea.containsMouse ? Theme.widgetBaseHoverColor : _tileBgInactive + return baseColor + } border.color: isActive ? _tileRingActive : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08) border.width: 0 opacity: enabled ? 1.0 : 0.6