feat(slint): browser-like back/forward navigation history
Add a navigation history so pages can be walked back and forward. - nav.rs: a back/forward stack of NavEntry (home, album, artist, settings); record() on fresh navigation, go_back/go_forward to walk it - NavButtons: a [<] [>] pair styled like the Discover tab group; inline beside the Discover tabs and in place of the per-page Back button on album, artist and settings views - All navigation routes through Rust (open-album/-artist record entries; the gear and header menu use NavState.request-settings) so the history stays accurate; back/forward re-apply entries, re-loading entity pages - AppShell listens for the mouse back/forward buttons - can-back / can-forward drive the buttons' enabled state Also in this round: - Album header description: render a pre-truncated short string so it wraps to a couple of lines instead of overflowing the header; the full text stays in the Read-more modal - Header queue button uses an ordered-list icon (the previous one read as a playlist) cc
This commit is contained in:
12 files changed
+461
-154
No files matched your search
@@ -13,6 +13,7 @@ import { QbzIcon } from "../primitives/QbzIcon.slint";
|
||||
import { ContextMenu } from "../primitives/ContextMenu.slint";
|
||||
import { ContextMenuItem } from "../primitives/ContextMenuItem.slint";
|
||||
import { Carousel } from "../discover/Carousel.slint";
|
||||
import { NavButtons } from "../shell/NavButtons.slint";
|
||||
|
||||
component CircleAction inherits Rectangle {
|
||||
in property <image> icon;
|
||||
@@ -199,32 +200,10 @@ export component ArtistPageView inherits Rectangle {
|
||||
spacing: 0px;
|
||||
alignment: start;
|
||||
|
||||
// --- Back button -------------------------------------------------
|
||||
back := TouchArea {
|
||||
width: back-row.preferred-width;
|
||||
height: 28px;
|
||||
mouse-cursor: pointer;
|
||||
clicked => {
|
||||
NavState.view = ContentView.home;
|
||||
}
|
||||
back-row := HorizontalLayout {
|
||||
spacing: 6px;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
QbzIcon {
|
||||
source: @image-url("../assets/icons/arrow-left.svg");
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
tint: back.has-hover ? Theme.text-secondary : Theme.text-muted;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: @tr("Back");
|
||||
color: back.has-hover ? Theme.text-secondary : Theme.text-muted;
|
||||
font-size: Typography.body;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
// --- History navigation ------------------------------------------
|
||||
HorizontalLayout {
|
||||
alignment: start;
|
||||
NavButtons { }
|
||||
}
|
||||
|
||||
Rectangle { height: 22px; }
|
||||
|
||||
Reference in new issue
Block a user