quickshell fixes
This commit is contained in:
1 parent
d2975650fa
commit
32b43bdbb3
68 files changed
+1461
-1047
No files matched your search
+29
-105
@@ -20,7 +20,7 @@ Popout {
|
||||
|
||||
PopoutSurface {
|
||||
anchors.fill: parent
|
||||
tone: Bt.enabled ? Theme.blue : Theme.muted
|
||||
tone: Bt.enabled ? Theme.accent : Theme.muted
|
||||
|
||||
PopoutHeader {
|
||||
id: header
|
||||
@@ -29,7 +29,7 @@ Popout {
|
||||
anchors.right: parent.right
|
||||
title: "Bluetooth"
|
||||
icon: Bt.icon
|
||||
accent: Theme.blue
|
||||
accent: Theme.accent
|
||||
subtitle: Bt.adapter ? Bt.adapter.name : "NO ADAPTER"
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ Popout {
|
||||
P5Button {
|
||||
text: Bt.enabled ? "On" : "Off"
|
||||
icon: Bt.enabled ? "" : ""
|
||||
accent: Bt.enabled ? Theme.blue : Theme.muted
|
||||
accent: Bt.enabled ? Theme.accent : Theme.muted
|
||||
onClicked: Bt.toggle()
|
||||
}
|
||||
|
||||
@@ -55,17 +55,13 @@ Popout {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
SectionRule {
|
||||
id: listLabel
|
||||
anchors.top: controls.bottom
|
||||
anchors.topMargin: Theme.padM
|
||||
anchors.left: parent.left
|
||||
text: Bt.devices.length > 0 ? "DEVICES" : "NO DEVICES"
|
||||
color: Theme.muted
|
||||
font.family: Theme.fontMono
|
||||
font.pixelSize: Theme.fsMicro
|
||||
font.letterSpacing: 2
|
||||
renderType: Text.NativeRendering
|
||||
anchors.right: parent.right
|
||||
text: Bt.devices.length > 0 ? "Devices" : "No devices"
|
||||
}
|
||||
|
||||
ListView {
|
||||
@@ -78,113 +74,41 @@ Popout {
|
||||
spacing: 2
|
||||
model: Bt.devices
|
||||
|
||||
delegate: Item {
|
||||
delegate: ListRow {
|
||||
id: devRow
|
||||
|
||||
required property BluetoothDevice modelData
|
||||
|
||||
width: ListView.view.width
|
||||
height: 34
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: devHover.hovered
|
||||
? Theme.alpha(Theme.blue, 0.16)
|
||||
: (devRow.modelData.connected ? Theme.alpha(Theme.blue, 0.08) : "transparent")
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 3
|
||||
height: devRow.modelData.connected ? 22 : 0
|
||||
color: Theme.accent
|
||||
|
||||
Behavior on height {
|
||||
NumberAnimation { duration: Theme.durBase; easing.type: Easing.OutBack }
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Theme.padM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.padS
|
||||
|
||||
Icon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: Bt.deviceIcon(devRow.modelData)
|
||||
color: devRow.modelData.connected ? Theme.blue : Theme.subtext
|
||||
font.pixelSize: Theme.fsLarge
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: -2
|
||||
|
||||
Text {
|
||||
text: Bt.deviceLabel(devRow.modelData)
|
||||
color: devRow.modelData.connected ? Theme.text : Theme.subtext
|
||||
font.family: Theme.fontDisplay
|
||||
font.pixelSize: Theme.fsSmall
|
||||
font.italic: true
|
||||
font.weight: devRow.modelData.connected ? Font.Black : Font.Medium
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Text {
|
||||
text: {
|
||||
if (devRow.modelData.pairing) return "pairing…";
|
||||
if (devRow.modelData.connected) return "connected";
|
||||
if (devRow.modelData.paired || devRow.modelData.bonded) return "paired";
|
||||
return devRow.modelData.address;
|
||||
}
|
||||
color: Theme.muted
|
||||
font.family: Theme.fontMono
|
||||
font.pixelSize: 8
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
icon: Bt.deviceIcon(modelData)
|
||||
label: Bt.deviceLabel(modelData)
|
||||
detail: {
|
||||
if (modelData.pairing) return "pairing…";
|
||||
if (modelData.connected) return "connected";
|
||||
if (modelData.paired || modelData.bonded) return "paired";
|
||||
return modelData.address;
|
||||
}
|
||||
current: modelData.connected
|
||||
onClicked: Bt.toggleDevice(modelData)
|
||||
onRightClicked: if (modelData.paired) modelData.forget()
|
||||
|
||||
// Device battery, where BlueZ exposes it.
|
||||
Row {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.padS
|
||||
Icon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 3
|
||||
visible: devRow.modelData.batteryAvailable
|
||||
|
||||
Icon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: ""
|
||||
color: devRow.modelData.battery > 0.25 ? Theme.ok : Theme.warn
|
||||
font.pixelSize: Theme.fsSmall
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: Math.round(devRow.modelData.battery * 100) + "%"
|
||||
color: Theme.subtext
|
||||
font.family: Theme.fontMono
|
||||
font.pixelSize: Theme.fsMicro
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
text: ""
|
||||
color: devRow.modelData.battery > 0.25 ? Theme.subtext : Theme.alarm
|
||||
font.pixelSize: Theme.fsSmall
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
id: devHover
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onTapped: Bt.toggleDevice(devRow.modelData)
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
onTapped: if (devRow.modelData.paired) devRow.modelData.forget()
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: devRow.modelData.batteryAvailable
|
||||
text: Math.round(devRow.modelData.battery * 100) + "%"
|
||||
color: Theme.subtext
|
||||
font.family: Theme.fontMono
|
||||
font.pixelSize: Theme.fsMicro
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user