Add services/Demand.qml, which holds one count on a service's demand counter while active. It replaces 13 hand-written consumer counters across the bar, Control Center, dashboard, media and desktop widgets. The desktop Cava widget now releases Cava while its desktop is covered. Add components/JumpValue.qml for the "animate only visible jumps" rule shared by the dashboard gauge and resource bars. Move the Settings sidebar (search and navigation) into settings/SettingsSidebar.qml and the drag handle into settings/controls/SettingsDragArea.qml, halving Settings.qml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
91 lines
3.1 KiB
QML
91 lines
3.1 KiB
QML
pragma ComponentBehavior: Bound
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import ".."
|
|
import "../../services"
|
|
import "../../core"
|
|
import "../../theme"
|
|
|
|
// Wi-Fi, Bluetooth and live throughput; labels open the matching Settings page.
|
|
ControlCard {
|
|
id: root
|
|
Demand {
|
|
service: MetricsService
|
|
}
|
|
component Entry: RowLayout {
|
|
id: entry
|
|
property alias toggle: toggle
|
|
property string title
|
|
property string detail
|
|
property string page
|
|
Layout.fillWidth: true
|
|
spacing: 10
|
|
CCToggle {
|
|
id: toggle
|
|
}
|
|
Item {
|
|
Layout.fillWidth: true
|
|
implicitHeight: labels.implicitHeight
|
|
ColumnLayout {
|
|
id: labels
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
spacing: 0
|
|
Text {
|
|
text: entry.title
|
|
color: Theme.text
|
|
font.pixelSize: 12
|
|
font.weight: Font.DemiBold
|
|
elide: Text.ElideRight
|
|
Layout.fillWidth: true
|
|
}
|
|
Text {
|
|
text: entry.detail
|
|
color: Theme.textSecondary
|
|
font.pixelSize: 11
|
|
elide: Text.ElideRight
|
|
Layout.fillWidth: true
|
|
}
|
|
}
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
onClicked: ShellState.openSettings(entry.page)
|
|
}
|
|
}
|
|
}
|
|
Entry {
|
|
title: "Wi-Fi"
|
|
detail: !NetworkService.available ? "No Wi-Fi adapter" : !NetworkService.backend.wifiHardwareEnabled ? "Hardware blocked" : NetworkService.enabled ? NetworkService.summary : "Off"
|
|
page: "network"
|
|
toggle.objectName: "wifiToggle"
|
|
toggle.glyph: NetworkService.enabled ? "" : ""
|
|
toggle.fallback: "W"
|
|
toggle.checked: NetworkService.available && NetworkService.enabled
|
|
toggle.enabled: NetworkService.available && NetworkService.backend.wifiHardwareEnabled
|
|
toggle.onClicked: NetworkService.toggle()
|
|
toggle.Accessible.name: "Wi-Fi"
|
|
}
|
|
Entry {
|
|
title: "Bluetooth"
|
|
detail: !BluetoothService.adapter ? "No adapter" : !BluetoothService.canToggle ? "Hardware blocked" : BluetoothService.summary
|
|
page: "bluetooth"
|
|
toggle.objectName: "bluetoothToggle"
|
|
toggle.glyph: BluetoothService.enabled ? "" : ""
|
|
toggle.fallback: "B"
|
|
toggle.checked: BluetoothService.enabled
|
|
toggle.enabled: BluetoothService.canToggle
|
|
toggle.onClicked: BluetoothService.toggle()
|
|
toggle.Accessible.name: "Bluetooth"
|
|
}
|
|
Entry {
|
|
title: "Network"
|
|
detail: "↓ " + MetricsService.bytes(MetricsService.network.download) + "/s ↑ " + MetricsService.bytes(MetricsService.network.upload) + "/s"
|
|
page: "metrics"
|
|
toggle.glyph: ""
|
|
toggle.fallback: "N"
|
|
toggle.onClicked: ShellState.openSettings("network")
|
|
toggle.Accessible.name: "Network settings"
|
|
}
|
|
}
|