panel title bar: add title, action buttons slot, divider; bt to popup mode; move wifi/bt toggles to title bar

This commit is contained in:
Damocles 2026-04-16 18:51:06 +02:00
parent 46f14d5d36
commit d4407ee538
7 changed files with 128 additions and 184 deletions

View file

@ -67,22 +67,37 @@ M.BarSection {
icon: "\uF294"
color: root.state === "off" ? M.Theme.base04 : root.accentColor
anchors.verticalCenter: parent.verticalCenter
TapHandler {
cursorShape: Qt.PointingHandCursor
onTapped: {
M.FlyoutState.visible = false;
btLoader.active = true;
}
}
}
M.BarLabel {
visible: root.state === "connected"
label: root.device + (root.batteryPct >= 0 ? " " + root.batteryPct + "%" : "")
anchors.verticalCenter: parent.verticalCenter
TapHandler {
cursorShape: Qt.PointingHandCursor
onTapped: {
M.FlyoutState.visible = false;
btLoader.active = true;
}
}
}
required property var bar
readonly property bool _anyHover: root._hovered || bluetoothMenu.panelHovered || bluetoothMenu._busy
M.BluetoothMenu {
id: bluetoothMenu
showPanel: root._anyHover
screen: root.bar.screen
anchorItem: root
accentColor: root.accentColor
LazyLoader {
id: btLoader
active: false
M.BluetoothMenu {
accentColor: root.accentColor
screen: QsWindow.window?.screen ?? null
anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
onDismissed: btLoader.active = false
}
}
}