app: give the window a palette and the settings a quick tab
The colours were rune's neutral defaults, so nothing tied the screens together. app/src/theme.rs now holds the palette: near-black surfaces tinted blue, brass for what the user acts on, mint and coral kept for results so champion art stays the loudest thing on screen. A test fails the build if a colour that carries text drops under 4.5:1 in either appearance. Settings lose the empty General tab: Quick holds quality, the audio and microphone switches, startup and the recordings folder; Recording keeps the encoder and output; Audio is three cards instead of five; Advanced absorbs the audio bitrate and reset. The back button moves to the left of the title bar, where window navigation belongs, and text fields right-align their value like every other control on the row. The microphone picker lists the devices with "System default" first, naming the default endpoint under the row. Two smaller repairs found on the way: the app picked record-daemon/target/release before debug, so it talked to a stale daemon after a debug build (the newest build now wins), and --snap forwarded its arguments to a running window instead of rendering.
This commit is contained in:
1 parent
b82225ce08
commit
3dfef1961d
8 files changed
+628
-368
No files matched your search
+49
-53
@@ -23,10 +23,10 @@ pub enum Screen {
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum SettingsTab {
|
||||
General,
|
||||
Quick,
|
||||
Recording,
|
||||
Audio,
|
||||
Daemon,
|
||||
Advanced,
|
||||
}
|
||||
|
||||
/// `GetStatusResponse`.
|
||||
@@ -138,7 +138,7 @@ impl App {
|
||||
let live = std::env::args().any(|arg| arg == "--live");
|
||||
let mut app = Self {
|
||||
screen: Screen::History,
|
||||
settings_tab: SettingsTab::General,
|
||||
settings_tab: SettingsTab::Quick,
|
||||
dark: true,
|
||||
daemon: Daemon::start(headless && !live),
|
||||
connected: false,
|
||||
@@ -543,11 +543,11 @@ fn status_color(p: Paint, app: &App) -> (rune::Color, String) {
|
||||
return (p.muted(), "Daemon offline".to_string());
|
||||
}
|
||||
if app.status.is_recording {
|
||||
return (p.danger(), "Recording".to_string());
|
||||
return (p.danger, "Recording".to_string());
|
||||
}
|
||||
if app.status.client_connected {
|
||||
return (
|
||||
p.success(),
|
||||
p.success,
|
||||
format!("{} · client connected", app.status.label()),
|
||||
);
|
||||
}
|
||||
@@ -576,7 +576,7 @@ fn statusbar(p: Paint, app: &App) -> El {
|
||||
.px(14.0)
|
||||
.gap(8.0)
|
||||
.center_y()
|
||||
.fill(p.t.bg)
|
||||
.fill(p.chrome)
|
||||
.border_sides([p.hair, 0.0, 0.0, 0.0], p.t.separator)
|
||||
.child(ui::dot(dot_color))
|
||||
.child(
|
||||
@@ -598,40 +598,48 @@ fn statusbar(p: Paint, app: &App) -> El {
|
||||
}
|
||||
|
||||
fn titlebar(p: Paint, app: &App) -> El {
|
||||
let actions = if app.screen == Screen::Settings {
|
||||
row().key("actions").gap(8.0).center_y().child(ui::button(
|
||||
// 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 {
|
||||
leading = leading.child(ui::button(
|
||||
p,
|
||||
"back",
|
||||
"← Match history",
|
||||
false,
|
||||
|app: &mut App| app.screen = Screen::History,
|
||||
));
|
||||
}
|
||||
let leading = leading.child(
|
||||
text("League Recorder")
|
||||
.key("title")
|
||||
.font(heading(13.0))
|
||||
.color(p.t.text),
|
||||
);
|
||||
let actions = row()
|
||||
.key("actions")
|
||||
.gap(8.0)
|
||||
.center_y()
|
||||
.child(ui::button(
|
||||
p,
|
||||
"refresh",
|
||||
"Refresh",
|
||||
false,
|
||||
|app: &mut App| {
|
||||
app.refresh_games();
|
||||
app.daemon.get_status();
|
||||
},
|
||||
))
|
||||
} else {
|
||||
row()
|
||||
.key("actions")
|
||||
.gap(8.0)
|
||||
.center_y()
|
||||
.child(ui::button(
|
||||
p,
|
||||
"refresh",
|
||||
"Refresh",
|
||||
false,
|
||||
|app: &mut App| {
|
||||
app.refresh_games();
|
||||
app.daemon.get_status();
|
||||
},
|
||||
))
|
||||
.child(ui::button(
|
||||
p,
|
||||
"open-settings",
|
||||
"Settings",
|
||||
false,
|
||||
|app: &mut App| {
|
||||
screens::review::leave(app);
|
||||
app.screen = Screen::Settings;
|
||||
},
|
||||
))
|
||||
};
|
||||
.child(ui::button(
|
||||
p,
|
||||
"open-settings",
|
||||
"Settings",
|
||||
false,
|
||||
|app: &mut App| {
|
||||
screens::review::leave(app);
|
||||
app.screen = Screen::Settings;
|
||||
},
|
||||
));
|
||||
row()
|
||||
.key("titlebar")
|
||||
.h(48.0)
|
||||
@@ -641,15 +649,11 @@ fn titlebar(p: Paint, app: &App) -> El {
|
||||
.center_y()
|
||||
.justify_between()
|
||||
.window_drag()
|
||||
.child(
|
||||
text("League Recorder")
|
||||
.key("title")
|
||||
.font(heading(13.0))
|
||||
.color(p.t.text),
|
||||
)
|
||||
.fill(p.chrome)
|
||||
.border_sides([0.0, 0.0, p.hair, 0.0], p.t.separator)
|
||||
.child(leading)
|
||||
.child(actions)
|
||||
}
|
||||
|
||||
fn notice(p: Paint, notice: &Notice) -> El {
|
||||
row()
|
||||
.key("notice")
|
||||
@@ -659,25 +663,17 @@ fn notice(p: Paint, notice: &Notice) -> El {
|
||||
.gap(8.0)
|
||||
.center_y()
|
||||
.fill(if notice.error {
|
||||
p.danger().alpha(0.16)
|
||||
p.danger.alpha(0.16)
|
||||
} else {
|
||||
p.success().alpha(0.16)
|
||||
p.success.alpha(0.16)
|
||||
})
|
||||
.on_press(|app: &mut App| app.notice = None)
|
||||
.child(ui::dot(if notice.error {
|
||||
p.danger()
|
||||
} else {
|
||||
p.success()
|
||||
}))
|
||||
.child(ui::dot(if notice.error { p.danger } else { p.success }))
|
||||
.child(
|
||||
text(notice.text.clone())
|
||||
.key("notice-text")
|
||||
.font(body(12.0))
|
||||
.color(if notice.error {
|
||||
p.danger()
|
||||
} else {
|
||||
p.success()
|
||||
})
|
||||
.color(if notice.error { p.danger } else { p.success })
|
||||
.grow(1.0)
|
||||
.shrink()
|
||||
.truncate(),
|
||||
|
||||
Reference in new issue
Block a user