bluetooth menu coming along
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
@@ -10,6 +11,8 @@ import "../Services/"
|
|||||||
Container {
|
Container {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property double devicePlaqeuSpacing
|
||||||
|
property double devicePlaqueHeight
|
||||||
required property HyprlandMonitor monitor
|
required property HyprlandMonitor monitor
|
||||||
property bool opened: false
|
property bool opened: false
|
||||||
|
|
||||||
@@ -38,6 +41,7 @@ Container {
|
|||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
root.boxHeight: 300
|
root.boxHeight: 300
|
||||||
|
root.boxRadius: 12
|
||||||
root.boxWidth: 350
|
root.boxWidth: 350
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,9 +82,18 @@ Container {
|
|||||||
id: deviceList
|
id: deviceList
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
property string component: "deviceList"
|
id: deviceListRoot
|
||||||
|
|
||||||
spacing: 3
|
property string component: "deviceList"
|
||||||
|
property double plaqueHeight: 60
|
||||||
|
property double plaqueSpacing: 4
|
||||||
|
|
||||||
|
spacing: plaqueSpacing
|
||||||
|
|
||||||
|
Item {
|
||||||
|
implicitHeight: 1
|
||||||
|
implicitWidth: 10
|
||||||
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
delegate: devicePlaque
|
delegate: devicePlaque
|
||||||
@@ -93,14 +106,45 @@ Container {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: devicePlaqueRoot
|
id: devicePlaqueRoot
|
||||||
|
|
||||||
|
readonly property variant deviceText: BluetoothManager.getDeviceText(modelData)
|
||||||
|
readonly property double margin: 5
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
||||||
color: Colors.surface1
|
color: Colors.surface1
|
||||||
implicitHeight: 10
|
implicitHeight: deviceListRoot.plaqueHeight
|
||||||
|
radius: 10
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
leftMargin: devicePlaqueRoot.margin
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
rightMargin: devicePlaqueRoot.margin
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: iconContainer
|
||||||
|
|
||||||
|
property double margin: 7
|
||||||
|
|
||||||
|
color: Colors.text
|
||||||
|
implicitWidth: deviceListRoot.plaqueHeight - (margin * 2)
|
||||||
|
radius: 4
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
bottom: parent.bottom
|
||||||
|
left: parent.left
|
||||||
|
margins: iconContainer.margin
|
||||||
|
top: parent.top
|
||||||
|
}
|
||||||
|
|
||||||
|
CenteredText {
|
||||||
|
fontSize: 17
|
||||||
|
text: devicePlaqueRoot.deviceText["icon"]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,17 @@ Singleton {
|
|||||||
return connectedList;
|
return connectedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDeviceText(device) {
|
||||||
|
let deviceName = device.deviceName;
|
||||||
|
|
||||||
|
let deviceIcon = getIcon(device.icon);
|
||||||
|
|
||||||
|
return {
|
||||||
|
"icon": deviceIcon,
|
||||||
|
"name": deviceName
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function getDevicesList() {
|
function getDevicesList() {
|
||||||
return root.defaultAdapter.devices.values;
|
return root.defaultAdapter.devices.values;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user