mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
feat: Priority pinned items in Control Center
This commit is contained in:
@@ -228,6 +228,10 @@ Singleton {
|
|||||||
property bool loginctlLockIntegration: true
|
property bool loginctlLockIntegration: true
|
||||||
property string launchPrefix: ""
|
property string launchPrefix: ""
|
||||||
property var brightnessDevicePins: ({})
|
property var brightnessDevicePins: ({})
|
||||||
|
property var wifiNetworkPins: ({})
|
||||||
|
property var bluetoothDevicePins: ({})
|
||||||
|
property var audioInputDevicePins: ({})
|
||||||
|
property var audioOutputDevicePins: ({})
|
||||||
|
|
||||||
property bool gtkThemingEnabled: false
|
property bool gtkThemingEnabled: false
|
||||||
property bool qtThemingEnabled: false
|
property bool qtThemingEnabled: false
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ var SPEC = {
|
|||||||
loginctlLockIntegration: { def: true },
|
loginctlLockIntegration: { def: true },
|
||||||
launchPrefix: { def: "" },
|
launchPrefix: { def: "" },
|
||||||
brightnessDevicePins: { def: {} },
|
brightnessDevicePins: { def: {} },
|
||||||
|
wifiNetworkPins: { def: {} },
|
||||||
|
bluetoothDevicePins: { def: {} },
|
||||||
|
audioInputDevicePins: { def: {} },
|
||||||
|
audioOutputDevicePins: { def: {} },
|
||||||
|
|
||||||
gtkThemingEnabled: { def: false, onChange: "regenSystemThemes" },
|
gtkThemingEnabled: { def: false, onChange: "regenSystemThemes" },
|
||||||
qtThemingEnabled: { def: false, onChange: "regenSystemThemes" },
|
qtThemingEnabled: { def: false, onChange: "regenSystemThemes" },
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import qs.Services
|
|||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
|
||||||
property bool hasInputVolumeSliderInCC: {
|
property bool hasInputVolumeSliderInCC: {
|
||||||
const widgets = SettingsData.controlCenterWidgets || []
|
const widgets = SettingsData.controlCenterWidgets || []
|
||||||
return widgets.some(widget => widget.id === "inputVolumeSlider")
|
return widgets.some(widget => widget.id === "inputVolumeSlider")
|
||||||
@@ -124,9 +126,25 @@ Rectangle {
|
|||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: Pipewire.nodes.values.filter(node => {
|
values: {
|
||||||
return node.audio && !node.isSink && !node.isStream
|
const nodes = Pipewire.nodes.values.filter(node => {
|
||||||
})
|
return node.audio && !node.isSink && !node.isStream
|
||||||
|
})
|
||||||
|
const pins = SettingsData.audioInputDevicePins || {}
|
||||||
|
const pinnedName = pins["preferredInput"]
|
||||||
|
|
||||||
|
let sorted = [...nodes]
|
||||||
|
sorted.sort((a, b) => {
|
||||||
|
// Pinned device first
|
||||||
|
if (a.name === pinnedName && b.name !== pinnedName) return -1
|
||||||
|
if (b.name === pinnedName && a.name !== pinnedName) return 1
|
||||||
|
// Then active device
|
||||||
|
if (a === AudioService.source && b !== AudioService.source) return -1
|
||||||
|
if (b === AudioService.source && a !== AudioService.source) return 1
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
return sorted
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
@@ -185,9 +203,69 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Theme.spacingM
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: pinInputRow.width + Theme.spacingS * 2
|
||||||
|
height: 28
|
||||||
|
radius: height / 2
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name
|
||||||
|
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05)
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: pinInputRow
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 4
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "push_pin"
|
||||||
|
size: 16
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name
|
||||||
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: {
|
||||||
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name
|
||||||
|
return isThisDevicePinned ? "Pinned" : "Pin"
|
||||||
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name
|
||||||
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
const pins = JSON.parse(JSON.stringify(SettingsData.audioInputDevicePins || {}))
|
||||||
|
const isCurrentlyPinned = pins["preferredInput"] === modelData.name
|
||||||
|
|
||||||
|
if (isCurrentlyPinned) {
|
||||||
|
delete pins["preferredInput"]
|
||||||
|
} else {
|
||||||
|
pins["preferredInput"] = modelData.name
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsData.set("audioInputDevicePins", pins)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: deviceMouseArea
|
id: deviceMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.rightMargin: pinInputRow.width + Theme.spacingS * 4
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import qs.Services
|
|||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
|
||||||
property bool hasVolumeSliderInCC: {
|
property bool hasVolumeSliderInCC: {
|
||||||
const widgets = SettingsData.controlCenterWidgets || []
|
const widgets = SettingsData.controlCenterWidgets || []
|
||||||
return widgets.some(widget => widget.id === "volumeSlider")
|
return widgets.some(widget => widget.id === "volumeSlider")
|
||||||
@@ -129,9 +131,25 @@ Rectangle {
|
|||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: Pipewire.nodes.values.filter(node => {
|
values: {
|
||||||
return node.audio && node.isSink && !node.isStream
|
const nodes = Pipewire.nodes.values.filter(node => {
|
||||||
})
|
return node.audio && node.isSink && !node.isStream
|
||||||
|
})
|
||||||
|
const pins = SettingsData.audioOutputDevicePins || {}
|
||||||
|
const pinnedName = pins["preferredOutput"]
|
||||||
|
|
||||||
|
let sorted = [...nodes]
|
||||||
|
sorted.sort((a, b) => {
|
||||||
|
// Pinned device first
|
||||||
|
if (a.name === pinnedName && b.name !== pinnedName) return -1
|
||||||
|
if (b.name === pinnedName && a.name !== pinnedName) return 1
|
||||||
|
// Then active device
|
||||||
|
if (a === AudioService.sink && b !== AudioService.sink) return -1
|
||||||
|
if (b === AudioService.sink && a !== AudioService.sink) return 1
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
return sorted
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
@@ -192,9 +210,69 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Theme.spacingM
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: pinOutputRow.width + Theme.spacingS * 2
|
||||||
|
height: 28
|
||||||
|
radius: height / 2
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name
|
||||||
|
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05)
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: pinOutputRow
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 4
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "push_pin"
|
||||||
|
size: 16
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name
|
||||||
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: {
|
||||||
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name
|
||||||
|
return isThisDevicePinned ? "Pinned" : "Pin"
|
||||||
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name
|
||||||
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
const pins = JSON.parse(JSON.stringify(SettingsData.audioOutputDevicePins || {}))
|
||||||
|
const isCurrentlyPinned = pins["preferredOutput"] === modelData.name
|
||||||
|
|
||||||
|
if (isCurrentlyPinned) {
|
||||||
|
delete pins["preferredOutput"]
|
||||||
|
} else {
|
||||||
|
pins["preferredOutput"] = modelData.name
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsData.set("audioOutputDevicePins", pins)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: deviceMouseArea
|
id: deviceMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.rightMargin: pinOutputRow.width + Theme.spacingS * 4
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: headerRow
|
id: headerRow
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@@ -150,10 +152,18 @@ Rectangle {
|
|||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.devices)
|
if (!BluetoothService.adapter || !BluetoothService.adapter.devices)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
const pins = SettingsData.bluetoothDevicePins || {}
|
||||||
|
const pinnedAddr = pins["preferredDevice"]
|
||||||
|
|
||||||
let devices = [...BluetoothService.adapter.devices.values.filter(dev => dev && (dev.paired || dev.trusted))]
|
let devices = [...BluetoothService.adapter.devices.values.filter(dev => dev && (dev.paired || dev.trusted))]
|
||||||
devices.sort((a, b) => {
|
devices.sort((a, b) => {
|
||||||
|
// Pinned device first
|
||||||
|
if (a.address === pinnedAddr && b.address !== pinnedAddr) return -1
|
||||||
|
if (b.address === pinnedAddr && a.address !== pinnedAddr) return 1
|
||||||
|
// Then connected devices
|
||||||
if (a.connected && !b.connected) return -1
|
if (a.connected && !b.connected) return -1
|
||||||
if (!a.connected && b.connected) return 1
|
if (!a.connected && b.connected) return 1
|
||||||
|
// Then by signal strength
|
||||||
return (b.signalStrength || 0) - (a.signalStrength || 0)
|
return (b.signalStrength || 0) - (a.signalStrength || 0)
|
||||||
})
|
})
|
||||||
return devices
|
return devices
|
||||||
@@ -273,6 +283,65 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.right: pairedOptionsButton.left
|
||||||
|
anchors.rightMargin: Theme.spacingS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: pinBluetoothRow.width + Theme.spacingS * 2
|
||||||
|
height: 28
|
||||||
|
radius: height / 2
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
|
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05)
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: pinBluetoothRow
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 4
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "push_pin"
|
||||||
|
size: 16
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: {
|
||||||
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
|
return isThisDevicePinned ? "Pinned" : "Pin"
|
||||||
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: {
|
||||||
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
const pins = JSON.parse(JSON.stringify(SettingsData.bluetoothDevicePins || {}))
|
||||||
|
const isCurrentlyPinned = pins["preferredDevice"] === modelData.address
|
||||||
|
|
||||||
|
if (isCurrentlyPinned) {
|
||||||
|
delete pins["preferredDevice"]
|
||||||
|
} else {
|
||||||
|
pins["preferredDevice"] = modelData.address
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsData.set("bluetoothDevicePins", pins)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
id: pairedOptionsButton
|
id: pairedOptionsButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@@ -293,7 +362,7 @@ Rectangle {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
id: deviceMouseArea
|
id: deviceMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.rightMargin: pairedOptionsButton.width + Theme.spacingS
|
anchors.rightMargin: pairedOptionsButton.width + Theme.spacingM + pinBluetoothRow.width + Theme.spacingS * 4
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import qs.Widgets
|
|||||||
import qs.Modals
|
import qs.Modals
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
|
||||||
implicitHeight: {
|
implicitHeight: {
|
||||||
if (NetworkService.wifiToggling) {
|
if (NetworkService.wifiToggling) {
|
||||||
return headerRow.height + wifiToggleContent.height + Theme.spacingM
|
return headerRow.height + wifiToggleContent.height + Theme.spacingM
|
||||||
@@ -93,6 +95,8 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: wifiToggleContent
|
id: wifiToggleContent
|
||||||
anchors.top: headerRow.bottom
|
anchors.top: headerRow.bottom
|
||||||
@@ -411,10 +415,18 @@ Rectangle {
|
|||||||
values: {
|
values: {
|
||||||
const ssid = NetworkService.currentWifiSSID
|
const ssid = NetworkService.currentWifiSSID
|
||||||
const networks = NetworkService.wifiNetworks
|
const networks = NetworkService.wifiNetworks
|
||||||
|
const pins = SettingsData.wifiNetworkPins || {}
|
||||||
|
const pinnedSSID = pins["preferredWifi"]
|
||||||
|
|
||||||
let sorted = [...networks]
|
let sorted = [...networks]
|
||||||
sorted.sort((a, b) => {
|
sorted.sort((a, b) => {
|
||||||
|
// Pinned network first
|
||||||
|
if (a.ssid === pinnedSSID && b.ssid !== pinnedSSID) return -1
|
||||||
|
if (b.ssid === pinnedSSID && a.ssid !== pinnedSSID) return 1
|
||||||
|
// Then currently connected
|
||||||
if (a.ssid === ssid) return -1
|
if (a.ssid === ssid) return -1
|
||||||
if (b.ssid === ssid) return 1
|
if (b.ssid === ssid) return 1
|
||||||
|
// Then by signal strength
|
||||||
return b.signal - a.signal
|
return b.signal - a.signal
|
||||||
})
|
})
|
||||||
if (!wifiContent.menuOpen) {
|
if (!wifiContent.menuOpen) {
|
||||||
@@ -514,10 +526,69 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: optionsButton.width + Theme.spacingM + Theme.spacingS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: pinWifiRow.width + Theme.spacingS * 2
|
||||||
|
height: 28
|
||||||
|
radius: height / 2
|
||||||
|
color: {
|
||||||
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid
|
||||||
|
return isThisNetworkPinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05)
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: pinWifiRow
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 4
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "push_pin"
|
||||||
|
size: 16
|
||||||
|
color: {
|
||||||
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid
|
||||||
|
return isThisNetworkPinned ? Theme.primary : Theme.surfaceText
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: {
|
||||||
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid
|
||||||
|
return isThisNetworkPinned ? "Pinned" : "Pin"
|
||||||
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: {
|
||||||
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid
|
||||||
|
return isThisNetworkPinned ? Theme.primary : Theme.surfaceText
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
const pins = JSON.parse(JSON.stringify(SettingsData.wifiNetworkPins || {}))
|
||||||
|
const isCurrentlyPinned = pins["preferredWifi"] === modelData.ssid
|
||||||
|
|
||||||
|
if (isCurrentlyPinned) {
|
||||||
|
delete pins["preferredWifi"]
|
||||||
|
} else {
|
||||||
|
pins["preferredWifi"] = modelData.ssid
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsData.set("wifiNetworkPins", pins)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: networkMouseArea
|
id: networkMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.rightMargin: optionsButton.width + Theme.spacingS
|
anchors.rightMargin: optionsButton.width + Theme.spacingM + Theme.spacingS + pinWifiRow.width + Theme.spacingS * 4
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: function(event) {
|
onClicked: function(event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user