1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 23:12:49 -05:00

update bluetooth not available visuals

This commit is contained in:
bbedward
2025-09-19 20:55:06 -04:00
parent 3376dc893d
commit 0055ddbc8d
3 changed files with 11 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ Rectangle {
property string secondaryText: "" property string secondaryText: ""
property bool expanded: false property bool expanded: false
property bool isActive: false property bool isActive: false
property bool showExpandArea: true
signal clicked() signal clicked()
signal expandClicked() signal expandClicked()
@@ -30,12 +31,12 @@ Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: parent.width - expandArea.width width: parent.width - (root.showExpandArea ? expandArea.width : 0)
topLeftRadius: Theme.cornerRadius topLeftRadius: Theme.cornerRadius
bottomLeftRadius: Theme.cornerRadius bottomLeftRadius: Theme.cornerRadius
topRightRadius: 0 topRightRadius: root.showExpandArea ? 0 : Theme.cornerRadius
bottomRightRadius: 0 bottomRightRadius: root.showExpandArea ? 0 : Theme.cornerRadius
color: mainAreaMouse.containsMouse ? color: showExpandArea && mainAreaMouse.containsMouse ?
Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) :
"transparent" "transparent"
@@ -54,7 +55,7 @@ Rectangle {
DankIcon { DankIcon {
name: root.iconName name: root.iconName
size: Theme.iconSize size: Theme.iconSize
color: root.isActive ? Theme.primary : root.iconColor color: Theme.primary
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
@@ -87,6 +88,7 @@ Rectangle {
MouseArea { MouseArea {
id: mainAreaMouse id: mainAreaMouse
visible: root.showExpandArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
@@ -103,6 +105,7 @@ Rectangle {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: Theme.iconSize + Theme.spacingM * 2 width: Theme.iconSize + Theme.spacingM * 2
visible: root.showExpandArea
topLeftRadius: 0 topLeftRadius: 0
bottomLeftRadius: 0 bottomLeftRadius: 0
topRightRadius: Theme.cornerRadius topRightRadius: Theme.cornerRadius

View File

@@ -37,6 +37,7 @@ BasePill {
} }
isActive: !!(BluetoothService.available && BluetoothService.adapter && BluetoothService.adapter.enabled) isActive: !!(BluetoothService.available && BluetoothService.adapter && BluetoothService.adapter.enabled)
showExpandArea: BluetoothService.available
primaryText: { primaryText: {
if (!BluetoothService.available) { if (!BluetoothService.available) {
@@ -53,7 +54,7 @@ BasePill {
secondaryText: { secondaryText: {
if (!BluetoothService.available) { if (!BluetoothService.available) {
return "Not available" return "No adapters"
} }
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) { if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) {
return "Off" return "Off"

View File

@@ -46,7 +46,7 @@ Rectangle {
DankIcon { DankIcon {
name: root.iconName name: root.iconName
size: Theme.iconSize size: Theme.iconSize
color: root.isActive ? Theme.primary : Theme.surfaceText color: Theme.primary
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }