add available devices and fix formatting/icons
This commit is contained in:
parent
622604ad08
commit
0bbb032823
6 changed files with 105 additions and 34 deletions
49
modules/bar/components/bluetooth/AvailableDevice.qml
Normal file
49
modules/bar/components/bluetooth/AvailableDevice.qml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs.config
|
||||
import qs.widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Bluetooth
|
||||
import Quickshell.Widgets
|
||||
|
||||
StyledLabel {
|
||||
id: root
|
||||
required property BluetoothDevice modelData
|
||||
|
||||
RowLayout {
|
||||
id: row
|
||||
|
||||
spacing: 8
|
||||
|
||||
Loader {
|
||||
active: root.modelData?.icon != undefined
|
||||
sourceComponent: IconImage {
|
||||
implicitSize: 22
|
||||
source: Quickshell.iconPath(root.modelData.icon, "device-support-unknown-symbolic")
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: root.modelData.deviceName
|
||||
}
|
||||
|
||||
StyledButton {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
hoverEnabled: !root.modelData.pairing
|
||||
color: containsMouse ? Theme.palette.primary : Theme.palette.base200
|
||||
content: StyledText {
|
||||
text: 'Pair'
|
||||
font.pixelSize: 12
|
||||
}
|
||||
onClicked: {
|
||||
if (!hoverEnabled) {
|
||||
return;
|
||||
}
|
||||
root.modelData.trusted = true;
|
||||
root.modelData.pair();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue