mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 23:42:51 -05:00
check disabled option on DankButtonGroup + always show bluetooth
placeholder
This commit is contained in:
@@ -70,6 +70,7 @@ Item {
|
|||||||
model: ["AC Power", "Battery"]
|
model: ["AC Power", "Battery"]
|
||||||
currentIndex: 0
|
currentIndex: 0
|
||||||
selectionMode: "single"
|
selectionMode: "single"
|
||||||
|
checkEnabled: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -607,11 +607,14 @@ DankPopout {
|
|||||||
width: (parent.width - Theme.spacingM) / 2
|
width: (parent.width - Theme.spacingM) / 2
|
||||||
expanded: root.expandedSection === "bluetooth"
|
expanded: root.expandedSection === "bluetooth"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
if (!BluetoothService.available) return
|
||||||
if (BluetoothService.adapter)
|
if (BluetoothService.adapter)
|
||||||
BluetoothService.adapter.enabled = !BluetoothService.adapter.enabled
|
BluetoothService.adapter.enabled = !BluetoothService.adapter.enabled
|
||||||
}
|
}
|
||||||
onExpandClicked: root.toggleSection("bluetooth")
|
onExpandClicked: {
|
||||||
visible: BluetoothService.available
|
if (!BluetoothService.available) return
|
||||||
|
root.toggleSection("bluetooth")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ BasePill {
|
|||||||
|
|
||||||
primaryText: {
|
primaryText: {
|
||||||
if (!BluetoothService.available) {
|
if (!BluetoothService.available) {
|
||||||
return "Bluetooth unavailable"
|
return "Bluetooth"
|
||||||
}
|
}
|
||||||
if (!BluetoothService.adapter) {
|
if (!BluetoothService.adapter) {
|
||||||
return "No adapter"
|
return "No adapter"
|
||||||
@@ -53,7 +53,7 @@ BasePill {
|
|||||||
|
|
||||||
secondaryText: {
|
secondaryText: {
|
||||||
if (!BluetoothService.available) {
|
if (!BluetoothService.available) {
|
||||||
return "Hardware not found"
|
return "Not available"
|
||||||
}
|
}
|
||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) {
|
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) {
|
||||||
return "Off"
|
return "Off"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ Row {
|
|||||||
property int currentIndex: -1
|
property int currentIndex: -1
|
||||||
property string selectionMode: "single"
|
property string selectionMode: "single"
|
||||||
property bool multiSelect: selectionMode === "multi"
|
property bool multiSelect: selectionMode === "multi"
|
||||||
|
property bool checkEnabled: true
|
||||||
|
|
||||||
signal selectionChanged(int index, bool selected)
|
signal selectionChanged(int index, bool selected)
|
||||||
|
|
||||||
@@ -143,7 +144,7 @@ Row {
|
|||||||
name: "check"
|
name: "check"
|
||||||
size: Theme.iconSizeSmall
|
size: Theme.iconSizeSmall
|
||||||
color: segment.selected ? Theme.surfaceText : Theme.primaryText
|
color: segment.selected ? Theme.surfaceText : Theme.primaryText
|
||||||
visible: segment.selected
|
visible: root.checkEnabled && segment.selected
|
||||||
opacity: segment.selected ? 1 : 0
|
opacity: segment.selected ? 1 : 0
|
||||||
scale: segment.selected ? 1 : 0.6
|
scale: segment.selected ? 1 : 0.6
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user