fix(qbz-qt): the app menu carries actions again, not settings
Intelligent search, Ambient background and Use system title bar were sitting in the hamburger menu. They are settings, not app-menu actions, and all three already have their real rows in Settings > Appearance — which is where Slint keeps them — so the menu was duplicating them in the wrong place. Documentation is added; it is the one Slint row that needed no surface the port lacks, just the external-link invokable QbzShell now has. Still missing against Slint, each waiting on a surface that does not exist here yet: Open Music Link, Keyboard Shortcuts, Report an Issue, What's New, About QBZ. They are named in the file header rather than shipped as rows that do nothing. build.rs now watches qml/ for changes. Cargo reruns a build script only when a source file changes, so dropping the new icon into qml/assets/ produced a binary whose qrc did not contain it — the file was on disk and the app logged "Cannot open" at runtime. That was going to bite every future asset. cc
No files matched your search
@@ -27,6 +27,14 @@ fn main() {
|
||||
// files in qml/ reference them relatively (e.g.
|
||||
// "assets/icons/primary/plus.svg").
|
||||
let qrc_refs: Vec<&str> = qrc_files.iter().map(String::as_str).collect();
|
||||
// Cargo's default is to rerun build.rs only when a source file changes, so
|
||||
// dropping a new icon into qml/assets/ produced a binary whose qrc did not
|
||||
// contain it — the file was on disk and the app logged "Cannot open".
|
||||
// Watch the whole tree instead.
|
||||
println!("cargo:rerun-if-changed=qml");
|
||||
for f in &qrc_files {
|
||||
println!("cargo:rerun-if-changed={f}");
|
||||
}
|
||||
|
||||
CxxQtBuilder::new()
|
||||
// Qt modules the bridge links against (Qt6 CMake in /usr/lib64/cmake).
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285f4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 7v14" />
|
||||
<path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 7v14" />
|
||||
<path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 7v14" />
|
||||
<path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#888888" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 7v14" />
|
||||
<path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 7v14" />
|
||||
<path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#cccccc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 7v14" />
|
||||
<path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#fbbf24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 7v14" />
|
||||
<path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -7,7 +7,9 @@
|
||||
// replica — the cortinilla/live-search is out of scope; POC-NOTE).
|
||||
// Right: the tri-state offline status badge with its flyout (recovery
|
||||
// "Sign in" wired to QbzSession.recoveryLogin) and the app menu (user block
|
||||
// + Log Out + Close; the other Slint menu items are POC-NOTE stubs).
|
||||
// + Documentation + Log Out + Close. Still missing vs Slint, each needing a
|
||||
// surface the port does not have yet: Open Music Link, Keyboard Shortcuts,
|
||||
// Report an Issue, What's New, About QBZ.
|
||||
//
|
||||
// POC-NOTE: the custom window-chrome parts (drag surface, drawn
|
||||
// min/max/close WindowControls) are skipped — the POC keeps NATIVE window
|
||||
@@ -603,38 +605,10 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
AppMenuItem {
|
||||
name: "search"
|
||||
label: QbzSession.tr("Intelligent search", QbzSession.trRev)
|
||||
checkedItem: QbzBridge.intelligentSearch
|
||||
onClicked: QbzBridge.toggleIntelligentSearch()
|
||||
}
|
||||
AppMenuItem {
|
||||
name: "layout-grid"
|
||||
label: QbzSession.tr("Ambient background", QbzSession.trRev)
|
||||
checkedItem: QbzShell.ambientMode > 0
|
||||
onClicked: {
|
||||
QbzShell.toggleAmbientBackground()
|
||||
// Applies LIVE (pure QML layering); the check flips now.
|
||||
}
|
||||
}
|
||||
AppMenuItem {
|
||||
name: "layout-grid"
|
||||
label: QbzSession.tr("Use system title bar", QbzSession.trRev)
|
||||
checkedItem: QbzShell.systemTitleBarPref
|
||||
onClicked: {
|
||||
QbzShell.toggleSystemTitleBar()
|
||||
// Keep the menu open so the check state reads; the
|
||||
// applied mode changes on the next launch (1:1 Slint).
|
||||
}
|
||||
}
|
||||
Text {
|
||||
width: parent.width
|
||||
leftPadding: 37
|
||||
text: QbzSession.tr("Takes effect after restarting QBZ.", QbzSession.trRev)
|
||||
color: theme.textMuted
|
||||
font.pixelSize: 11
|
||||
}
|
||||
// The app menu carries ACTIONS. Intelligent search, Ambient
|
||||
// background and Use system title bar were settings living here by
|
||||
// accident; all three already have their real rows in
|
||||
// Settings > Appearance, which is where Slint keeps them.
|
||||
AppMenuItem {
|
||||
name: "settings-2"
|
||||
label: QbzSession.tr("Settings", QbzSession.trRev)
|
||||
@@ -643,6 +617,14 @@ Rectangle {
|
||||
QbzShell.navigateTo("settings")
|
||||
}
|
||||
}
|
||||
AppMenuItem {
|
||||
name: "book-open"
|
||||
label: QbzSession.tr("Documentation", QbzSession.trRev)
|
||||
onClicked: {
|
||||
appMenu.close()
|
||||
QbzShell.openExternalUrl("https://github.com/vicrodh/qbz/wiki")
|
||||
}
|
||||
}
|
||||
AppMenuItem {
|
||||
name: "log-out"
|
||||
label: QbzSession.tr("Log Out", QbzSession.trRev)
|
||||
|
||||
@@ -144,6 +144,10 @@ pub mod qbz_shell {
|
||||
/// and lazy-load its data on first visit.
|
||||
#[qinvokable]
|
||||
fn navigate_to(self: Pin<&mut QbzShell>, view: QString);
|
||||
/// Open a url in the system browser (the Slint
|
||||
/// AlbumActions.open-external-link). Spawns xdg-open detached.
|
||||
#[qinvokable]
|
||||
fn open_external_url(self: Pin<&mut QbzShell>, url: QString);
|
||||
|
||||
/// Now-Playing-view flyout: switch the bar mode (0 New / 1 Classic /
|
||||
/// 2 Small / 3 Large) — persists ui_prefs.npb_mode; Large forces the
|
||||
@@ -440,4 +444,11 @@ impl qbz_shell::QbzShell {
|
||||
pub fn drag_end(self: Pin<&mut Self>) {
|
||||
crate::drag_end();
|
||||
}
|
||||
pub fn open_external_url(self: Pin<&mut Self>, url: QString) {
|
||||
let url = url.to_string();
|
||||
if let Err(e) = open::that(&url) {
|
||||
log::warn!("[qbz-qt] failed to open '{url}': {e}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||