Auto-formatting
This commit is contained in:
parent
4510762a35
commit
b0917f5a25
6 changed files with 42 additions and 43 deletions
|
|
@ -21,7 +21,6 @@ Item {
|
|||
implicitWidth: pill.width
|
||||
implicitHeight: pill.height
|
||||
|
||||
|
||||
// Helper to evaluate and possibly notify
|
||||
function maybeNotify(percent, charging) {
|
||||
const p = Math.round(percent)
|
||||
|
|
|
|||
|
|
@ -210,7 +210,6 @@ ColumnLayout {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
|
||||
// Call to action
|
||||
Rectangle {
|
||||
Layout.preferredWidth: 80 * scaling
|
||||
|
|
@ -269,7 +268,8 @@ ColumnLayout {
|
|||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: (canConnect || canDisconnect) && !isBusy ? Qt.PointingHandCursor : (isBusy ? Qt.BusyCursor : Qt.ArrowCursor)
|
||||
cursorShape: (canConnect || canDisconnect)
|
||||
&& !isBusy ? Qt.PointingHandCursor : (isBusy ? Qt.BusyCursor : Qt.ArrowCursor)
|
||||
onEntered: {
|
||||
if (root.tooltipText && !isBusy) {
|
||||
tooltip.show()
|
||||
|
|
@ -290,7 +290,6 @@ ColumnLayout {
|
|||
tooltip.hide()
|
||||
}
|
||||
|
||||
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
if (modelData.connected) {
|
||||
BluetoothService.disconnectDevice(modelData)
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@ NPanel {
|
|||
BluetoothDevicesList {
|
||||
label: "Connected devices"
|
||||
property var items: {
|
||||
if (!BluetoothService.adapter || !Bluetooth.devices) return []
|
||||
if (!BluetoothService.adapter || !Bluetooth.devices)
|
||||
return []
|
||||
var filtered = Bluetooth.devices.values.filter(dev => dev && !dev.blocked && dev.connected)
|
||||
return BluetoothService.sortDevices(filtered)
|
||||
}
|
||||
|
|
@ -98,8 +99,10 @@ NPanel {
|
|||
label: "Known devices"
|
||||
tooltipText: "Left click to connect, right click to forget"
|
||||
property var items: {
|
||||
if (!BluetoothService.adapter || !Bluetooth.devices) return []
|
||||
var filtered = Bluetooth.devices.values.filter(dev => dev && !dev.blocked && !dev.connected && (dev.paired || dev.trusted))
|
||||
if (!BluetoothService.adapter || !Bluetooth.devices)
|
||||
return []
|
||||
var filtered = Bluetooth.devices.values.filter(dev => dev && !dev.blocked && !dev.connected
|
||||
&& (dev.paired || dev.trusted))
|
||||
return BluetoothService.sortDevices(filtered)
|
||||
}
|
||||
model: items
|
||||
|
|
@ -111,7 +114,8 @@ NPanel {
|
|||
BluetoothDevicesList {
|
||||
label: "Available devices"
|
||||
property var items: {
|
||||
if (!BluetoothService.adapter || !Bluetooth.devices) return []
|
||||
if (!BluetoothService.adapter || !Bluetooth.devices)
|
||||
return []
|
||||
var filtered = Bluetooth.devices.values.filter(dev => dev && !dev.blocked && !dev.paired && !dev.trusted)
|
||||
return BluetoothService.sortDevices(filtered)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,8 @@ Singleton {
|
|||
function canConnect(device) {
|
||||
if (!device)
|
||||
return false
|
||||
|
||||
|
||||
/*
|
||||
Paired
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ Singleton {
|
|||
// Do not filter out invalid displays. For some reason --brief returns some invalid which works fine
|
||||
var displays = text.trim().split("\n\n")
|
||||
|
||||
|
||||
ddcProc.ddcMonitors = displays.map(d => {
|
||||
|
||||
var ddcModelMatc = d.match(/This monitor does not support DDC\/CI/)
|
||||
|
|
@ -85,19 +84,15 @@ Singleton {
|
|||
var ddcModel = ddcModelMatc ? ddcModelMatc.length > 0 : false
|
||||
var model = modelMatch ? modelMatch[1] : "Unknown"
|
||||
var bus = busMatch ? busMatch[1] : "Unknown"
|
||||
Logger.log(
|
||||
"Detected DDC Monitor:", model,
|
||||
"on bus", bus, "is DDC:", !ddcModel
|
||||
)
|
||||
Logger.log("Detected DDC Monitor:", model, "on bus", bus, "is DDC:",
|
||||
!ddcModel)
|
||||
return {
|
||||
"model": model,
|
||||
"busNum": bus,
|
||||
"isDdc": !ddcModel,
|
||||
"isDdc": !ddcModel
|
||||
}
|
||||
})
|
||||
root.ddcMonitors = ddcProc.ddcMonitors.filter(m => m.isDdc)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue