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:
1 parent
673cddfff6
commit
5ab3161bf5
2 files changed
+7
-12
No files matched your search
+7
-2
@@ -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
|
// Leaving a screen is on the left, where a window's back arrow lives; the app's own
|
||||||
// actions stay on the right.
|
// actions stay on the right.
|
||||||
let mut leading = row().key("leading").gap(8.0).center_y();
|
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(
|
leading = leading.child(ui::button(
|
||||||
p,
|
p,
|
||||||
"back",
|
"back",
|
||||||
"← Match history",
|
"← Match history",
|
||||||
false,
|
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(
|
let leading = leading.child(
|
||||||
|
|||||||
@@ -473,16 +473,6 @@ pub fn view(app: &App, p: Paint) -> El {
|
|||||||
.key("review-title")
|
.key("review-title")
|
||||||
.gap(10.0)
|
.gap(10.0)
|
||||||
.center_y()
|
.center_y()
|
||||||
.child(ui::button(
|
|
||||||
p,
|
|
||||||
"back",
|
|
||||||
"← Match history",
|
|
||||||
false,
|
|
||||||
|app: &mut App| {
|
|
||||||
leave(app);
|
|
||||||
app.screen = Screen::History;
|
|
||||||
},
|
|
||||||
))
|
|
||||||
.child(ui::champion_portrait(
|
.child(ui::champion_portrait(
|
||||||
app,
|
app,
|
||||||
p,
|
p,
|
||||||
|
|||||||
Reference in new issue
Block a user