app: move the review back arrow into the title bar

Settings already leaves the screen from the title bar, while the review
kept its own back button in the header beside the champion portrait.
Both screens now share the title bar button, and the review header
starts with the portrait.

The button still calls leave, so the player and the soundtrack stop on
the way out.
This commit is contained in:
vhaudiquet committed 2026-11-19 18:55:02 +01:00
1 parent 673cddfff6
commit 5ab3161bf5
2 files changed
+7 -12

No files matched your search

+7 -2
View File
@@ -851,13 +851,18 @@ fn titlebar(p: Paint, app: &App) -> El {
// Leaving a screen is on the left, where a window's back arrow lives; the app's own
// actions stay on the right.
let mut leading = row().key("leading").gap(8.0).center_y();
if app.screen == Screen::Settings {
if matches!(app.screen, Screen::Settings | Screen::Review) {
leading = leading.child(ui::button(
p,
"back",
"← Match history",
false,
|app: &mut App| app.screen = Screen::History,
|app: &mut App| {
if app.screen == Screen::Review {
screens::review::leave(app);
}
app.screen = Screen::History;
},
));
}
let leading = leading.child(
-10
View File
@@ -473,16 +473,6 @@ pub fn view(app: &App, p: Paint) -> El {
.key("review-title")
.gap(10.0)
.center_y()
.child(ui::button(
p,
"back",
"← Match history",
false,
|app: &mut App| {
leave(app);
app.screen = Screen::History;
},
))
.child(ui::champion_portrait(
app,
p,