controlcenter/bt: better toggles collapsing logic

Hardcoded but eh
This commit is contained in:
2 * r + 2 * t 2025-08-05 16:31:32 +10:00
parent fb650907a0
commit 8cc78cfaf3

View file

@ -17,6 +17,8 @@ ColumnLayout {
id: root
required property Session session
readonly property bool smallDiscoverable: width <= 540
readonly property bool smallPairable: width <= 480
anchors.fill: parent
spacing: Appearance.spacing.small
@ -48,8 +50,8 @@ ColumnLayout {
ToggleButton {
toggled: Bluetooth.defaultAdapter?.discoverable ?? false
icon: QsWindow.window.screen.height <= 1080 ? "group_search" : ""
label: QsWindow.window.screen.height <= 1080 ? "" : qsTr("Discoverable")
icon: root.smallDiscoverable ? "group_search" : ""
label: root.smallDiscoverable ? "" : qsTr("Discoverable")
function onClicked(): void {
const adapter = Bluetooth.defaultAdapter;
@ -61,7 +63,7 @@ ColumnLayout {
ToggleButton {
toggled: Bluetooth.defaultAdapter?.pairable ?? false
icon: "missing_controller"
label: QsWindow.window.screen.height <= 960 ? "" : qsTr("Pairable")
label: root.smallPairable ? "" : qsTr("Pairable")
function onClicked(): void {
const adapter = Bluetooth.defaultAdapter;