feat(qt): Purchases follows the section navigation, sidebar or header

The separate "Purchases in title bar" placement toggle is gone: with Show
Purchases on, the entry sits wherever the other sections are — in the
sidebar while the navigation lives there, in the header beside the full
tabs or the compact buttons otherwise — so it is never the one entry left
behind. The nav_tb_purchases pref and its bridge key are retired; the
Show Purchases description says where the entry goes.

cc
This commit is contained in:
vicrodh committed 2026-09-13 11:28:44 -06:00
1 parent d22907b0e0
commit db7ddc5edd
12 files changed
+53 -50

No files matched your search

@@ -7623,3 +7623,7 @@ msgstr "-23 LUFS · Rundfunk (EBU R128)"
#: qbz-qt/src/settings_qt.rs
msgid "Custom ({} LUFS)"
msgstr "Benutzerdefiniert ({} LUFS)"
#: qbz-qt/qml/settings/NavigationSettings.qml
msgid "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
msgstr "Zeigt den Bereich Käufe neben den anderen Bereichen – in der Seitenleiste oder in der Kopfzeile, wo immer sie sind – zum Stöbern und Herunterladen deiner gekauften Musik"
@@ -3253,3 +3253,7 @@ msgstr "-23 LUFS · Broadcast (EBU R128)"
#: qbz-qt/src/settings_qt.rs
msgid "Custom ({} LUFS)"
msgstr "Custom ({} LUFS)"
#: qbz-qt/qml/settings/NavigationSettings.qml
msgid "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
msgstr "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
@@ -7629,3 +7629,7 @@ msgstr "-23 LUFS · Radiodifusión (EBU R128)"
#: qbz-qt/src/settings_qt.rs
msgid "Custom ({} LUFS)"
msgstr "Personalizado ({} LUFS)"
#: qbz-qt/qml/settings/NavigationSettings.qml
msgid "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
msgstr "Muestra la sección Compras junto a las demás secciones (en la barra lateral o en el encabezado, donde estén) para explorar y descargar tu música comprada"
@@ -7621,3 +7621,7 @@ msgstr "-23 LUFS · Diffusion (EBU R128)"
#: qbz-qt/src/settings_qt.rs
msgid "Custom ({} LUFS)"
msgstr "Personnalisé ({} LUFS)"
#: qbz-qt/qml/settings/NavigationSettings.qml
msgid "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
msgstr "Affiche la section Achats à côté des autres sections — dans la barre latérale ou l'en-tête, où qu'elles soient — pour parcourir et télécharger votre musique achetée"
@@ -7604,3 +7604,7 @@ msgstr "-23 LUFS · 放送 (EBU R128)"
#: qbz-qt/src/settings_qt.rs
msgid "Custom ({} LUFS)"
msgstr "カスタム({} LUFS)"
#: qbz-qt/qml/settings/NavigationSettings.qml
msgid "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
msgstr "購入セクションを他のセクションと同じ場所(サイドバーまたはヘッダー)に表示し、購入した音楽を閲覧・ダウンロードできます"
@@ -7611,3 +7611,7 @@ msgstr "-23 LUFS · Omroep (EBU R128)"
#: qbz-qt/src/settings_qt.rs
msgid "Custom ({} LUFS)"
msgstr "Aangepast ({} LUFS)"
#: qbz-qt/qml/settings/NavigationSettings.qml
msgid "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
msgstr "Toont de sectie Aankopen naast de andere secties — in de zijbalk of de koptekst, waar ze ook staan — om je gekochte muziek te bekijken en te downloaden"
@@ -7621,3 +7621,7 @@ msgstr "-23 LUFS · Radiodifusão (EBU R128)"
#: qbz-qt/src/settings_qt.rs
msgid "Custom ({} LUFS)"
msgstr "Personalizado ({} LUFS)"
#: qbz-qt/qml/settings/NavigationSettings.qml
msgid "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
msgstr "Mostra a seção Compras ao lado das outras seções (na barra lateral ou no cabeçalho, onde estiverem) para navegar e baixar suas músicas compradas"
@@ -7642,3 +7642,7 @@ msgstr "-23 LUFS · Вещание (EBU R128)"
#: qbz-qt/src/settings_qt.rs
msgid "Custom ({} LUFS)"
msgstr "Своё значение ({} LUFS)"
#: qbz-qt/qml/settings/NavigationSettings.qml
msgid "Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music"
msgstr "Показывает раздел «Покупки» рядом с остальными разделами — в боковой панели или в заголовке, где бы они ни были — для просмотра и загрузки купленной музыки"
@@ -92,25 +92,14 @@ Column {
}
SettingRow { kioskHost: root.kioskHost;
label: QbzSession.tr("Show Purchases", QbzSession.trRev)
description: QbzSession.tr("Show the Purchases section in the sidebar for browsing and downloading your purchased music", QbzSession.trRev)
// Purchases follows the other sections — sidebar or header — so the
// separate "in title bar" placement toggle is gone (2026-09-13).
description: QbzSession.tr("Show the Purchases section beside the other sections — in the sidebar or the header, wherever they are — for browsing and downloading your purchased music", QbzSession.trRev)
QbzToggle { kioskHost: root.kioskHost;
checked: root.doc.showPurchases === true
onToggled: function (v) { QbzBridge.settingsBool("show-purchases", v) }
}
}
SettingRow { kioskHost: root.kioskHost;
// Nothing to place while the section itself is off (owner
// 2026-08-21) — absent rather than rendered-and-inert.
visible: root.doc.showPurchases === true
label: QbzSession.tr("Purchases in title bar", QbzSession.trRev)
description: QbzSession.tr("Place the Purchases entry in the custom title bar instead of the sidebar", QbzSession.trRev)
rowEnabled: !root.tbLocked
QbzToggle { kioskHost: root.kioskHost;
enabled: !root.tbLocked
checked: root.doc.navTbPurchases === true
onToggled: function (v) { QbzBridge.settingsBool("nav-tb-purchases", v) }
}
}
SettingsSpacer { }
SettingsDivider { }
+5 -13
View File
@@ -175,15 +175,14 @@ Rectangle {
try { return JSON.parse(QbzBridge.settingsJson) } catch (e) { return ({}) }
}
// Follow navigation into the header, including the closed-sidebar fallback.
// The separate relocation preference also works while navigation stays in
// the sidebar; only that explicit title-bar placement needs custom chrome.
// Purchases FOLLOWS the section nav (2026-09-13): it is up here exactly
// when the sections are — the full tabs, or the compact buttons while
// the sidebar is closed / "Compact header navigation" is on — and in the
// sidebar otherwise (Sidebar.qml `purchasesVisible`).
readonly property bool purchasesInHeader:
root.settingsDoc.showPurchases === true
&& !QbzSession.offline
&& (root.headerTabsOn || root.headerCompactOn
|| (root.settingsDoc.navTbPurchases === true
&& !QbzShell.systemTitleBar && !QbzShell.hideTitleBar))
&& (root.headerTabsOn || root.headerCompactOn)
// Highlighted section — derived from the live view (see NavFlyout), OR'd
// in the triggers with "my menu is open" (Slint highlights off
@@ -452,13 +451,6 @@ Rectangle {
}
}
// Explicit Purchases relocation with the other navigation in the sidebar.
PurchaseTab {
visible: root.purchasesInHeader && !root.headerTabsOn && !root.headerCompactOn
showIcon: root.width >= 1140
anchors.verticalCenter: parent.verticalCenter
}
// Compact section nav — while the sidebar is fully closed (so the
// sections stay reachable), or always when the nav is in the header
// and "Compact header navigation" is ON (HeaderBar.slint:974).
+13 -16
View File
@@ -53,9 +53,10 @@
// PURCHASES is the one row in that block that is NOT a section: it is a
// DirectRow (SidebarDirectRow) — no dropdown, no catalog entry, it just
// navigates — and it is triple-gated (opt-in `show_purchases`, hidden while
// offline, and relocated to the custom title bar by `nav_tb_purchases`).
// Both prefs default OFF, so on a stock install this block is still the same
// four section rows it has always been.
// offline, and shown only while the sections themselves live here: with the
// navigation in the header it follows them up there). The pref defaults
// OFF, so on a stock install this block is still the same four section rows
// it has always been.
// The playlist/folder tree below the nav IS live (sidebar_qt.rs: load, sort,
// search, expand/collapse, drag-drop target), and so is everything the "..."
// menu offers: New folder opens QbzFolderEdit's create panel (the small
@@ -146,9 +147,9 @@ Rectangle {
// NO new bridge property is needed. `settings_bool`'s tail is
// unconditional on success — `publish_snapshot()` re-serialises the WHOLE
// settings document after every successful write (settings_qt.rs:2278-2285)
// — and both prefs are already in it (`showPurchases` / `navTbPurchases`,
// :1446-1449). So the two Appearance toggles reach this row through
// QbzBridge.settingsJson and nothing else is wired.
// — and the pref is already in it (`showPurchases`). So the Navigation
// toggle reaches this row through QbzBridge.settingsJson and nothing
// else is wired.
//
// GUARDED parse, the NavFlyout.qml:65-70 precedent: a bare JSON.parse in a
// binding throws on the pre-publish frame and would take the whole sidebar
@@ -156,19 +157,15 @@ Rectangle {
readonly property var settingsDoc: {
try { return JSON.parse(QbzBridge.settingsJson) } catch (e) { return ({}) }
}
// `show_purchases` is the MASTER gate; `nav_tb_purchases` only RELOCATES
// the entry to the custom title bar — and it can only relocate it when
// there IS one. Under the system chrome, or with no title bar at all, the
// entry stays here (the truth table's fourth row): the Appearance toggle
// is disabled in those states, but a `true` set earlier survives the
// switch, and honouring it then would make Purchases unreachable.
// Both prefs default false — Purchases ships hidden.
// `show_purchases` is the MASTER gate. Purchases then FOLLOWS the other
// sections (2026-09-13): it sits here while the navigation lives in the
// sidebar, and in the header beside them otherwise (HeaderBar.qml
// `purchasesInHeader`) — never the one entry left behind. The pref
// defaults false: Purchases ships hidden.
readonly property bool purchasesVisible:
root.settingsDoc.showPurchases === true
&& !QbzSession.offline
&& !(root.settingsDoc.navTbPurchases === true
&& !QbzShell.systemTitleBar
&& !QbzShell.hideTitleBar)
&& QbzShell.navInSidebar
// Playlist tree state (phase 7).
property bool searchOpen: false
-7
View File
@@ -2258,8 +2258,6 @@ pub struct SettingsDoc {
pub startup_page_index: i32,
#[serde(rename = "showPurchases")]
pub show_purchases: bool,
#[serde(rename = "navTbPurchases")]
pub nav_tb_purchases: bool,
/// Opt-in: a click on a top-level section row (Discover / Library / Local
/// Library / My QBZ) also NAVIGATES, landing on that section's first entry.
/// Off by default, which is the behaviour that shipped: a click only opens
@@ -2807,7 +2805,6 @@ pub async fn publish_snapshot() {
startup_pages: STARTUP_PAGE_LABELS.iter().map(|l| qbz_i18n::t(l)).collect(),
startup_page_index: index_of(STARTUP_PAGE_VALUES, &pref_str("startup_page", "home"), 0),
show_purchases: pref_bool("show_purchases", false),
nav_tb_purchases: pref_bool("nav_tb_purchases", false),
nav_click_first_tab: pref_bool("nav_click_first_tab", false),
local_tab_order: local_tab_order(),
genre_filters_position: local_genre_filters_position(),
@@ -3757,10 +3754,6 @@ pub async fn settings_bool(runtime: &Arc<AppRuntime<LoggingAdapter>>, key: &str,
save_pref("show_purchases", serde_json::json!(value));
Ok(Apply::None)
}
"nav-tb-purchases" => {
save_pref("nav_tb_purchases", serde_json::json!(value));
Ok(Apply::None)
}
// Read by BOTH nav hosts off `settingsJson` (shell/NavFlyout.qml), so
// there is nothing to apply here beyond the write and the republish
// every settings toggle already does.