Skip to content

Commit 514b4cb

Browse files
committed
omamobile-shell 0.2.157: the bar's Bluetooth item opens quick settings' Bluetooth panel
Omarchy's Bluetooth card neither makes the phone visible nor shows the code a pairing asks to confirm, so a car or headset couldn't be paired from the bar. The bar now opens the same panel as the Bluetooth tile's chevron, so the phone has one Bluetooth screen.
1 parent 0794e9a commit 514b4cb

3 files changed

Lines changed: 20 additions & 18 deletions

File tree

‎packages/omamobile-shell/plugins/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ on an empty part does nothing:
6565
| --- | --- |
6666
| Battery | Omarchy's own power panel (`plugins/panels/power/Panel.qml` from `OMARCHY_PATH`) |
6767
| Wi-Fi or Ethernet | Omarchy's network panel (`plugins/panels/network`) |
68-
| Bluetooth | Omarchy's Bluetooth panel (`plugins/panels/bluetooth`) |
68+
| Bluetooth | Quick settings' Bluetooth panel, as its tile's chevron opens it: it makes the phone visible while open and shows a pairing's code, which Omarchy's card doesn't |
6969
| Cellular signal | `CellularPanel.qml`: the carrier, its state, a mobile data switch (`omamobile-sit data on/off`), the signal and whether calls, texts and mobile data work |
7070
| Clock | `TimePanel.qml`: the day, the date, the time and the time zone |
7171

72-
Omarchy's three panels are loaded unchanged and unseen; only their popups
72+
Omarchy's two panels are loaded unchanged and unseen; only their popups
7373
show. Omarchy has no card for the clock that fits a phone's width and none for
7474
a modem, so the two others are built from the same parts (`Panel`,
7575
`KeyboardPanel`, `ToggleSwitch` and the label/value rows of the power card).

‎packages/omamobile-shell/plugins/omamobile.bar/Bar.qml‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ Item {
282282
shell.summon(quickSettingsId, JSON.stringify({ source: "bar" }))
283283
}
284284

285+
function openBluetoothPanel() {
286+
if (shell && typeof shell.summon === "function")
287+
shell.summon(quickSettingsId, JSON.stringify({ source: "bar", page: "bluetooth" }))
288+
}
289+
285290
function toggleQuickSettings() {
286291
if (shell && typeof shell.toggle === "function")
287292
shell.toggle(quickSettingsId, JSON.stringify({ source: "bar" }))
@@ -466,16 +471,10 @@ Item {
466471
text: root.bluetoothConnected ? "󰂱" : "󰂯"
467472
}
468473

469-
// Omarchy's bluetooth panel, unseen but for its popup.
470-
Loader {
471-
id: bluetoothPanel
472-
anchors.fill: parent
473-
active: root.cardsOnTap
474-
source: "file://" + root.omarchyPath + "/shell/plugins/panels/bluetooth/Panel.qml"
475-
onLoaded: { item.bar = root; item.opacity = 0 }
476-
}
477-
478-
// With bar.cardsOnTap, a tap opens the card; a pull opens quick settings.
474+
// With bar.cardsOnTap, a tap opens quick settings' Bluetooth panel
475+
// (not Omarchy's card: the phone's panel makes the phone visible
476+
// while it is open and shows the code a pairing asks to confirm);
477+
// a pull opens quick settings.
479478
MouseArea {
480479
anchors.fill: parent
481480
anchors.leftMargin: -Style.space(8)
@@ -487,8 +486,8 @@ Item {
487486
onPositionChanged: function(mouse) {
488487
if (!pulled && mouse.y - pressY > Style.space(14)) { pulled = true; root.openQuickSettings() }
489488
}
490-
onClicked: if (!pulled && bluetoothPanel.item) bluetoothPanel.item.toggle()
491-
function triggerPress(button) { if (bluetoothPanel.item) bluetoothPanel.item.toggle() }
489+
onClicked: if (!pulled) root.openBluetoothPanel()
490+
function triggerPress(button) { root.openBluetoothPanel() }
492491
Component.onCompleted: root.clickTargets = root.clickTargets.concat([this])
493492
Component.onDestruction: root.clickTargets = root.clickTargets.filter(function(t) { return t !== this }, this)
494493
}

‎packages/omamobile-shell/test/all‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,19 +302,22 @@ grep -c 'anchors.bottom: createFooter.top' $h/HomeSheets.qml >/dev/null || fail
302302
pass "touch navigation: back, home pill, drawer pull, undo, fields in view"
303303

304304
# The bar's cards: a tap on an item opens its card as a click does in Omarchy's
305-
# bar (Omarchy's own power, network and Bluetooth panels, loaded unchanged;
306-
# the time and mobile network cards built from Omarchy's panel parts), every
305+
# bar (Omarchy's own power and network panels, loaded unchanged; quick
306+
# settings' Bluetooth panel; the time and mobile network cards built from
307+
# Omarchy's panel parts), every
307308
# item is a click target so an open card hands a tap on another item to it,
308309
# and only a pull opens quick settings.
309310
b=plugins/omamobile.bar/Bar.qml
310-
for panel in power network bluetooth; do
311+
for panel in power network; do
311312
grep -cF "\"/shell/plugins/panels/$panel/Panel.qml\"" "$b" >/dev/null || fail "the bar loads Omarchy's own $panel panel"
312313
done
313314
[[ $(grep -c 'Component.onCompleted: root.clickTargets = root.clickTargets.concat(\[this\])' "$b") == 5 ]] || fail "all five items are click targets of an open card"
314315
[[ $(grep -c 'function triggerPress(button)' "$b") == 5 ]] || fail "a tap an open card hands on opens that item's card"
315316
awk '/id: touch$/,/^ }$/' "$b" | grep -cF 'onClicked: if (!pulled && !root.cardsOnTap) root.toggleQuickSettings()' >/dev/null || fail "a tap on the strip toggles quick settings only with bar.cardsOnTap off"
316317
grep -cF 'readonly property bool cardsOnTap: setting("cardsOnTap", false) === true' "$b" >/dev/null || fail "the cards are behind bar.cardsOnTap, off by default"
317-
[[ $(grep -c 'enabled: root.cardsOnTap' "$b") == 5 && $(grep -c 'active: root.cardsOnTap' "$b") == 5 ]] || fail "with bar.cardsOnTap off no item takes a tap and no card is loaded"
318+
[[ $(grep -c 'enabled: root.cardsOnTap' "$b") == 5 && $(grep -c 'active: root.cardsOnTap' "$b") == 4 ]] || fail "with bar.cardsOnTap off no item takes a tap and no card is loaded"
319+
grep -cF "panels/bluetooth/Panel.qml" "$b" >/dev/null && fail "the Bluetooth item opens quick settings' panel, not Omarchy's card"
320+
grep -cF 'shell.summon(quickSettingsId, JSON.stringify({ source: "bar", page: "bluetooth" }))' "$b" >/dev/null || fail "the Bluetooth item opens quick settings' Bluetooth panel"
318321
awk '/id: touch$/,/^ }$/' "$b" | grep -c 'root.openQuickSettings()' >/dev/null || fail "a pull on the bar opens quick settings"
319322
grep -cF 'sourceComponent: CellularPanel {' "$b" >/dev/null || fail "the signal opens the mobile network card"
320323
grep -cF 'sourceComponent: TimePanel {' "$b" >/dev/null || fail "the clock opens the time card"

0 commit comments

Comments
 (0)