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)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum SettingsTab {
|
pub enum SettingsTab {
|
||||||
General,
|
Quick,
|
||||||
Recording,
|
Recording,
|
||||||
Audio,
|
Audio,
|
||||||
Daemon,
|
Advanced,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `GetStatusResponse`.
|
/// `GetStatusResponse`.
|
||||||
@@ -138,7 +138,7 @@ impl App {
|
|||||||
let live = std::env::args().any(|arg| arg == "--live");
|
let live = std::env::args().any(|arg| arg == "--live");
|
||||||
let mut app = Self {
|
let mut app = Self {
|
||||||
screen: Screen::History,
|
screen: Screen::History,
|
||||||
settings_tab: SettingsTab::General,
|
settings_tab: SettingsTab::Quick,
|
||||||
dark: true,
|
dark: true,
|
||||||
daemon: Daemon::start(headless && !live),
|
daemon: Daemon::start(headless && !live),
|
||||||
connected: false,
|
connected: false,
|
||||||
@@ -543,11 +543,11 @@ fn status_color(p: Paint, app: &App) -> (rune::Color, String) {
|
|||||||
return (p.muted(), "Daemon offline".to_string());
|
return (p.muted(), "Daemon offline".to_string());
|
||||||
}
|
}
|
||||||
if app.status.is_recording {
|
if app.status.is_recording {
|
||||||
return (p.danger(), "Recording".to_string());
|
return (p.danger, "Recording".to_string());
|
||||||
}
|
}
|
||||||
if app.status.client_connected {
|
if app.status.client_connected {
|
||||||
return (
|
return (
|
||||||
p.success(),
|
p.success,
|
||||||
format!("{} · client connected", app.status.label()),
|
format!("{} · client connected", app.status.label()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -576,7 +576,7 @@ fn statusbar(p: Paint, app: &App) -> El {
|
|||||||
.px(14.0)
|
.px(14.0)
|
||||||
.gap(8.0)
|
.gap(8.0)
|
||||||
.center_y()
|
.center_y()
|
||||||
.fill(p.t.bg)
|
.fill(p.chrome)
|
||||||
.border_sides([p.hair, 0.0, 0.0, 0.0], p.t.separator)
|
.border_sides([p.hair, 0.0, 0.0, 0.0], p.t.separator)
|
||||||
.child(ui::dot(dot_color))
|
.child(ui::dot(dot_color))
|
||||||
.child(
|
.child(
|
||||||
@@ -598,40 +598,48 @@ fn statusbar(p: Paint, app: &App) -> El {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn titlebar(p: Paint, app: &App) -> El {
|
fn titlebar(p: Paint, app: &App) -> El {
|
||||||
let actions = if app.screen == Screen::Settings {
|
// Leaving a screen is on the left, where a window's back arrow lives; the app's own
|
||||||
row().key("actions").gap(8.0).center_y().child(ui::button(
|
// 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,
|
p,
|
||||||
"back",
|
"back",
|
||||||
"← Match history",
|
"← Match history",
|
||||||
false,
|
false,
|
||||||
|app: &mut App| app.screen = Screen::History,
|
|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 {
|
.child(ui::button(
|
||||||
row()
|
p,
|
||||||
.key("actions")
|
"open-settings",
|
||||||
.gap(8.0)
|
"Settings",
|
||||||
.center_y()
|
false,
|
||||||
.child(ui::button(
|
|app: &mut App| {
|
||||||
p,
|
screens::review::leave(app);
|
||||||
"refresh",
|
app.screen = Screen::Settings;
|
||||||
"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;
|
|
||||||
},
|
|
||||||
))
|
|
||||||
};
|
|
||||||
row()
|
row()
|
||||||
.key("titlebar")
|
.key("titlebar")
|
||||||
.h(48.0)
|
.h(48.0)
|
||||||
@@ -641,15 +649,11 @@ fn titlebar(p: Paint, app: &App) -> El {
|
|||||||
.center_y()
|
.center_y()
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.window_drag()
|
.window_drag()
|
||||||
.child(
|
.fill(p.chrome)
|
||||||
text("League Recorder")
|
.border_sides([0.0, 0.0, p.hair, 0.0], p.t.separator)
|
||||||
.key("title")
|
.child(leading)
|
||||||
.font(heading(13.0))
|
|
||||||
.color(p.t.text),
|
|
||||||
)
|
|
||||||
.child(actions)
|
.child(actions)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn notice(p: Paint, notice: &Notice) -> El {
|
fn notice(p: Paint, notice: &Notice) -> El {
|
||||||
row()
|
row()
|
||||||
.key("notice")
|
.key("notice")
|
||||||
@@ -659,25 +663,17 @@ fn notice(p: Paint, notice: &Notice) -> El {
|
|||||||
.gap(8.0)
|
.gap(8.0)
|
||||||
.center_y()
|
.center_y()
|
||||||
.fill(if notice.error {
|
.fill(if notice.error {
|
||||||
p.danger().alpha(0.16)
|
p.danger.alpha(0.16)
|
||||||
} else {
|
} else {
|
||||||
p.success().alpha(0.16)
|
p.success.alpha(0.16)
|
||||||
})
|
})
|
||||||
.on_press(|app: &mut App| app.notice = None)
|
.on_press(|app: &mut App| app.notice = None)
|
||||||
.child(ui::dot(if notice.error {
|
.child(ui::dot(if notice.error { p.danger } else { p.success }))
|
||||||
p.danger()
|
|
||||||
} else {
|
|
||||||
p.success()
|
|
||||||
}))
|
|
||||||
.child(
|
.child(
|
||||||
text(notice.text.clone())
|
text(notice.text.clone())
|
||||||
.key("notice-text")
|
.key("notice-text")
|
||||||
.font(body(12.0))
|
.font(body(12.0))
|
||||||
.color(if notice.error {
|
.color(if notice.error { p.danger } else { p.success })
|
||||||
p.danger()
|
|
||||||
} else {
|
|
||||||
p.success()
|
|
||||||
})
|
|
||||||
.grow(1.0)
|
.grow(1.0)
|
||||||
.shrink()
|
.shrink()
|
||||||
.truncate(),
|
.truncate(),
|
||||||
|
|||||||
+30
-21
@@ -30,6 +30,10 @@ pub fn log_file() -> Option<PathBuf> {
|
|||||||
|
|
||||||
/// Find the record-daemon binary next to the app, in an installed `resources` folder, or in a
|
/// Find the record-daemon binary next to the app, in an installed `resources` folder, or in a
|
||||||
/// development checkout.
|
/// development checkout.
|
||||||
|
///
|
||||||
|
/// A checkout can hold both `target/debug` and `target/release`, one of them stale; the newest
|
||||||
|
/// build wins, so the app talks to the daemon that was built last ("cargo build" then "cargo
|
||||||
|
/// run", rather than a release build from another week).
|
||||||
pub fn find_binary() -> Option<PathBuf> {
|
pub fn find_binary() -> Option<PathBuf> {
|
||||||
let name = if cfg!(windows) {
|
let name = if cfg!(windows) {
|
||||||
"record-daemon.exe"
|
"record-daemon.exe"
|
||||||
@@ -49,34 +53,39 @@ pub fn find_binary() -> Option<PathBuf> {
|
|||||||
return Some(resources);
|
return Some(resources);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut dir = exe_dir.to_path_buf();
|
if let Some(found) = newest_build(exe_dir, name) {
|
||||||
for _ in 0..6 {
|
return Some(found);
|
||||||
for suffix in ["record-daemon/target/release", "record-daemon/target/debug"] {
|
|
||||||
let candidate = dir.join(suffix).join(name);
|
|
||||||
if candidate.exists() {
|
|
||||||
return Some(candidate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !dir.pop() {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let cwd = std::env::current_dir().ok()?;
|
newest_build(&std::env::current_dir().ok()?, name)
|
||||||
let mut dir = cwd.as_path();
|
}
|
||||||
for _ in 0..5 {
|
|
||||||
for suffix in ["record-daemon/target/release", "record-daemon/target/debug"] {
|
/// The most recently built daemon in a checkout, walking up from `start`.
|
||||||
let candidate = dir.join(suffix).join(name);
|
fn newest_build(start: &Path, name: &str) -> Option<PathBuf> {
|
||||||
if candidate.exists() {
|
let mut dir = start.to_path_buf();
|
||||||
return Some(candidate);
|
for _ in 0..6 {
|
||||||
}
|
let candidates = [
|
||||||
|
dir.join("record-daemon/target/release").join(name),
|
||||||
|
dir.join("record-daemon/target/debug").join(name),
|
||||||
|
];
|
||||||
|
if let Some(found) = candidates
|
||||||
|
.into_iter()
|
||||||
|
.filter_map(|path| {
|
||||||
|
let modified = std::fs::metadata(&path).ok()?.modified().ok()?;
|
||||||
|
Some((modified, path))
|
||||||
|
})
|
||||||
|
.max_by_key(|(modified, _)| *modified)
|
||||||
|
.map(|(_, path)| path)
|
||||||
|
{
|
||||||
|
return Some(found);
|
||||||
|
}
|
||||||
|
if !dir.pop() {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
dir = dir.parent()?;
|
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Start the daemon detached, so it outlives the app.
|
/// Start the daemon detached, so it outlives the app.
|
||||||
pub fn spawn() -> Result<PathBuf, String> {
|
pub fn spawn() -> Result<PathBuf, String> {
|
||||||
let binary = find_binary().ok_or_else(|| {
|
let binary = find_binary().ok_or_else(|| {
|
||||||
|
|||||||
+5
-3
@@ -14,6 +14,7 @@ mod os;
|
|||||||
mod portraits;
|
mod portraits;
|
||||||
mod screens;
|
mod screens;
|
||||||
mod settings;
|
mod settings;
|
||||||
|
mod theme;
|
||||||
mod ui;
|
mod ui;
|
||||||
|
|
||||||
use rune::AppSpec;
|
use rune::AppSpec;
|
||||||
@@ -27,8 +28,9 @@ fn main() {
|
|||||||
probe();
|
probe();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// A second launch hands its arguments to the first and exits.
|
// A second launch hands its arguments to the first and exits; the tooling modes
|
||||||
if !rune::single_instance(os::APP_ID) {
|
// (`--snap`, `--tree`, that sort of thing) render or print and exit, so they never forward.
|
||||||
|
if !app::headless() && !rune::single_instance(os::APP_ID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
os::register_notifications();
|
os::register_notifications();
|
||||||
@@ -60,7 +62,7 @@ fn main() {
|
|||||||
}),
|
}),
|
||||||
("daemon", |app| {
|
("daemon", |app| {
|
||||||
app.screen = app::Screen::Settings;
|
app.screen = app::Screen::Settings;
|
||||||
app.settings_tab = app::SettingsTab::Daemon;
|
app.settings_tab = app::SettingsTab::Advanced;
|
||||||
}),
|
}),
|
||||||
("review", |app| app::demo_review(app)),
|
("review", |app| app::demo_review(app)),
|
||||||
("details", |app| {
|
("details", |app| {
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ fn filter_label(filter: Option<QueueCategory>) -> &'static str {
|
|||||||
|
|
||||||
fn outcome_color(p: Paint, outcome: Outcome) -> Color {
|
fn outcome_color(p: Paint, outcome: Outcome) -> Color {
|
||||||
match outcome {
|
match outcome {
|
||||||
Outcome::Victory => p.success(),
|
Outcome::Victory => p.success,
|
||||||
Outcome::Defeat => p.danger(),
|
Outcome::Defeat => p.danger,
|
||||||
Outcome::Terminated => p.muted(),
|
Outcome::Terminated => p.muted(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,11 +183,7 @@ fn game_card(app: &App, p: Paint, game: &Timeline, index: usize) -> El {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
if let Some(lp) = &lp {
|
if let Some(lp) = &lp {
|
||||||
let lp_ink = if lp.delta >= 0 {
|
let lp_ink = if lp.delta >= 0 { p.success } else { p.danger };
|
||||||
p.success()
|
|
||||||
} else {
|
|
||||||
p.danger()
|
|
||||||
};
|
|
||||||
banner = banner.child(
|
banner = banner.child(
|
||||||
text(format!(
|
text(format!(
|
||||||
"{} LP · {}",
|
"{} LP · {}",
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ pub fn view(app: &App, p: Paint) -> El {
|
|||||||
};
|
};
|
||||||
let outcome = game.outcome();
|
let outcome = game.outcome();
|
||||||
let ink = match outcome {
|
let ink = match outcome {
|
||||||
Outcome::Victory => p.success(),
|
Outcome::Victory => p.success,
|
||||||
Outcome::Defeat => p.danger(),
|
Outcome::Defeat => p.danger,
|
||||||
Outcome::Terminated => p.muted(),
|
Outcome::Terminated => p.muted(),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -397,9 +397,9 @@ fn scrubber(app: &App, p: Paint, game: &Timeline) -> El {
|
|||||||
let x = (clip.start / duration).clamp(0.0, 1.0) as f32 * width;
|
let x = (clip.start / duration).clamp(0.0, 1.0) as f32 * width;
|
||||||
let end = (clip.end / duration).clamp(0.0, 1.0) as f32 * width;
|
let end = (clip.end / duration).clamp(0.0, 1.0) as f32 * width;
|
||||||
let ink = match clip.kind {
|
let ink = match clip.kind {
|
||||||
highlight::Kind::Death => p.danger(),
|
highlight::Kind::Death => p.danger,
|
||||||
highlight::Kind::Assist => p.muted(),
|
highlight::Kind::Assist => p.muted(),
|
||||||
_ => p.success(),
|
_ => p.success,
|
||||||
};
|
};
|
||||||
bar = bar.child(
|
bar = bar.child(
|
||||||
el().key(format!("clip-{index}"))
|
el().key(format!("clip-{index}"))
|
||||||
@@ -435,8 +435,8 @@ fn scrubber(app: &App, p: Paint, game: &Timeline) -> El {
|
|||||||
.and_then(|name| highlight::involvement(event, name));
|
.and_then(|name| highlight::involvement(event, name));
|
||||||
let ink = match event.event_type.as_str() {
|
let ink = match event.event_type.as_str() {
|
||||||
"kill" => match involvement {
|
"kill" => match involvement {
|
||||||
Some(highlight::Kind::Death) => p.danger(),
|
Some(highlight::Kind::Death) => p.danger,
|
||||||
Some(_) => p.success(),
|
Some(_) => p.success,
|
||||||
None => p.muted().alpha(0.75),
|
None => p.muted().alpha(0.75),
|
||||||
},
|
},
|
||||||
"objective" | "lp_change" => p.accent,
|
"objective" | "lp_change" => p.accent,
|
||||||
@@ -494,10 +494,10 @@ fn highlights(app: &App, p: Paint, game: &Timeline) -> El {
|
|||||||
let video = game.video_path().map(|path| path.display().to_string());
|
let video = game.video_path().map(|path| path.display().to_string());
|
||||||
let name = format!("{}-highlight-{}", game.recording_id, index);
|
let name = format!("{}-highlight-{}", game.recording_id, index);
|
||||||
let kind_ink = match clip.kind {
|
let kind_ink = match clip.kind {
|
||||||
highlight::Kind::Death => p.danger(),
|
highlight::Kind::Death => p.danger,
|
||||||
highlight::Kind::Assist => p.muted(),
|
highlight::Kind::Assist => p.muted(),
|
||||||
highlight::Kind::MultiKill | highlight::Kind::TradeKill => p.accent,
|
highlight::Kind::MultiKill | highlight::Kind::TradeKill => p.accent,
|
||||||
highlight::Kind::Kill => p.success(),
|
highlight::Kind::Kill => p.success,
|
||||||
};
|
};
|
||||||
let mut actions = row().key("actions").gap(6.0).center_y().child(ui::button(
|
let mut actions = row().key("actions").gap(6.0).center_y().child(ui::button(
|
||||||
p,
|
p,
|
||||||
|
|||||||
+311
-260
@@ -1,4 +1,4 @@
|
|||||||
//! Settings: general, recording, audio and daemon tabs, saved through `updateSettings`.
|
//! Settings: a quick tab of everyday choices, then recording, audio and the daemon.
|
||||||
|
|
||||||
use rune::tok::{radius, space, type_};
|
use rune::tok::{radius, space, type_};
|
||||||
use rune::{El, TextEdit, col, row, text};
|
use rune::{El, TextEdit, col, row, text};
|
||||||
@@ -141,25 +141,13 @@ const SOURCE_TYPES: [&str; 3] = ["Application", "Output device", "Input device"]
|
|||||||
/// A row with a single-line field on the right.
|
/// A row with a single-line field on the right.
|
||||||
fn text_row(
|
fn text_row(
|
||||||
p: Paint,
|
p: Paint,
|
||||||
kit: &rune_kit::Kit,
|
|
||||||
key: &'static str,
|
key: &'static str,
|
||||||
label: &str,
|
label: &str,
|
||||||
hint: &str,
|
hint: &str,
|
||||||
edit: &TextEdit,
|
edit: &TextEdit,
|
||||||
to: fn(&mut App) -> &mut TextEdit,
|
to: fn(&mut App) -> &mut TextEdit,
|
||||||
) -> El {
|
) -> El {
|
||||||
ui::setting_row_with(
|
ui::setting_row_with(p, key, label, hint, ui::text_field(p, key, label, edit, to))
|
||||||
p,
|
|
||||||
key,
|
|
||||||
label,
|
|
||||||
hint,
|
|
||||||
rune_kit::TextInput::new(edit)
|
|
||||||
.label(label)
|
|
||||||
.on_edit(to)
|
|
||||||
.width(Some(220.0))
|
|
||||||
.on_change(|app: &mut App, _| app.form.dirty = true)
|
|
||||||
.build(kit),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)] // the columns of a settings row
|
#[allow(clippy::too_many_arguments)] // the columns of a settings row
|
||||||
@@ -199,10 +187,10 @@ fn select_row(
|
|||||||
fn tabs(p: Paint, app: &App) -> El {
|
fn tabs(p: Paint, app: &App) -> El {
|
||||||
let mut row = row().key("tabs").gap(4.0).center_y();
|
let mut row = row().key("tabs").gap(4.0).center_y();
|
||||||
for (tab, label) in [
|
for (tab, label) in [
|
||||||
(SettingsTab::General, "General"),
|
(SettingsTab::Quick, "Quick"),
|
||||||
(SettingsTab::Recording, "Recording"),
|
(SettingsTab::Recording, "Recording"),
|
||||||
(SettingsTab::Audio, "Audio"),
|
(SettingsTab::Audio, "Audio"),
|
||||||
(SettingsTab::Daemon, "Advanced"),
|
(SettingsTab::Advanced, "Advanced"),
|
||||||
] {
|
] {
|
||||||
row = row.child(ui::tab(
|
row = row.child(ui::tab(
|
||||||
p,
|
p,
|
||||||
@@ -221,19 +209,20 @@ fn tabs(p: Paint, app: &App) -> El {
|
|||||||
pub fn view(app: &App, p: Paint) -> El {
|
pub fn view(app: &App, p: Paint) -> El {
|
||||||
let kit = rune_kit::Kit::neutral(app.dark);
|
let kit = rune_kit::Kit::neutral(app.dark);
|
||||||
let mut layer = Vec::new();
|
let mut layer = Vec::new();
|
||||||
|
let (save_text, save_ink) = save_label(app, p);
|
||||||
|
|
||||||
// The scroll bar gets its own strip at the end, clear of the cards.
|
// The scroll bar gets its own strip at the end, clear of the cards.
|
||||||
let content = col()
|
let content = col()
|
||||||
.key("tab-content")
|
.key("tab-content")
|
||||||
.w_full()
|
.w_full()
|
||||||
.gap(space::S6)
|
.gap(20.0)
|
||||||
.pb(space::S6)
|
.pb(space::S6)
|
||||||
.pr(14.0);
|
.pr(14.0);
|
||||||
let content = match app.settings_tab {
|
let content = match app.settings_tab {
|
||||||
SettingsTab::General => general(app, p, &kit, &mut layer, content),
|
SettingsTab::Quick => quick(app, p, &kit, &mut layer, content),
|
||||||
SettingsTab::Recording => recording(app, p, &kit, &mut layer, content),
|
SettingsTab::Recording => recording(app, p, &kit, &mut layer, content),
|
||||||
SettingsTab::Audio => audio(app, p, &kit, &mut layer, content),
|
SettingsTab::Audio => audio(app, p, &kit, &mut layer, content),
|
||||||
SettingsTab::Daemon => daemon_tab(app, p, &kit, &mut layer, content),
|
SettingsTab::Advanced => advanced(app, p, &kit, &mut layer, content),
|
||||||
};
|
};
|
||||||
|
|
||||||
let body = col()
|
let body = col()
|
||||||
@@ -261,10 +250,10 @@ pub fn view(app: &App, p: Paint) -> El {
|
|||||||
.center_y()
|
.center_y()
|
||||||
.child(
|
.child(
|
||||||
row().key("save-state").mr(4.0).center_y().child(
|
row().key("save-state").mr(4.0).center_y().child(
|
||||||
text(save_label(app))
|
text(save_text)
|
||||||
.key("save-label")
|
.key("save-label")
|
||||||
.font(body(11.5))
|
.font(body(11.5))
|
||||||
.color(p.muted()),
|
.color(save_ink),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.child(ui::button(p, "revert", "Revert", false, |app: &mut App| {
|
.child(ui::button(p, "revert", "Revert", false, |app: &mut App| {
|
||||||
@@ -306,15 +295,15 @@ pub fn view(app: &App, p: Paint) -> El {
|
|||||||
rune_kit::root(body, layer)
|
rune_kit::root(body, layer)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn save_label(app: &App) -> String {
|
fn save_label(app: &App, p: Paint) -> (String, rune::Color) {
|
||||||
if !app.connected {
|
if !app.connected {
|
||||||
"Daemon offline".into()
|
("Daemon offline".into(), p.danger)
|
||||||
} else if app.form.dirty {
|
} else if app.form.dirty {
|
||||||
"Unsaved changes".into()
|
("Unsaved changes".into(), p.warning)
|
||||||
} else if app.form.loaded {
|
} else if app.form.loaded {
|
||||||
"Saved".into()
|
("Saved".into(), p.muted())
|
||||||
} else {
|
} else {
|
||||||
"Loading".into()
|
("Loading".into(), p.muted())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,24 +317,55 @@ fn save_footer(p: Paint, _app: &App) -> El {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn general(_app: &App, p: Paint, _kit: &rune_kit::Kit, _layer: &mut Vec<El>, content: El) -> El {
|
/// The settings most people touch: how a clip looks, whether it has sound, and where it lands.
|
||||||
|
fn quick(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content: El) -> El {
|
||||||
|
let v = &app.form.draft.video;
|
||||||
|
let a = &app.form.draft.audio;
|
||||||
content
|
content
|
||||||
|
.child(
|
||||||
|
text("Recording starts on its own when a game begins, and the game shows up here when it ends.")
|
||||||
|
.key("quick-note")
|
||||||
|
.font(body(12.5))
|
||||||
|
.color(p.muted()),
|
||||||
|
)
|
||||||
.child(ui::card(
|
.child(ui::card(
|
||||||
p,
|
p,
|
||||||
Some("Recording"),
|
Some("Recording"),
|
||||||
vec![
|
vec![
|
||||||
text("Recording starts by itself when a game begins and stops when the game ends.")
|
select_row(
|
||||||
.key("auto-note")
|
p,
|
||||||
.font(body(12.5))
|
kit,
|
||||||
.color(p.muted())
|
layer,
|
||||||
.px(space::S3)
|
"quality",
|
||||||
.py(space::S3),
|
"Quality",
|
||||||
text("A finished game shows up in the match history on its own.")
|
v.quality.detail(),
|
||||||
.key("history-note")
|
&QUALITIES,
|
||||||
.font(body(12.5))
|
Some(v.quality.label().to_string()),
|
||||||
.color(p.muted())
|
app,
|
||||||
.px(space::S3)
|
),
|
||||||
.pb(space::S3),
|
ui::toggle_row(
|
||||||
|
p,
|
||||||
|
"quick-audio",
|
||||||
|
"Record game audio",
|
||||||
|
a.enabled && a.capture_game,
|
||||||
|
|app: &mut App| {
|
||||||
|
let on = !(app.form.draft.audio.enabled && app.form.draft.audio.capture_game);
|
||||||
|
app.form.draft.audio.enabled = on;
|
||||||
|
app.form.draft.audio.capture_game = on;
|
||||||
|
app.form.dirty = true;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ui::toggle_row(
|
||||||
|
p,
|
||||||
|
"quick-mic",
|
||||||
|
"Record my microphone",
|
||||||
|
a.capture_mic,
|
||||||
|
|app: &mut App| {
|
||||||
|
app.form.draft.audio.capture_mic ^= true;
|
||||||
|
app.form.dirty = true;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
mic_row(p, kit, layer, app, "quick-mic-device"),
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
.child(ui::card(
|
.child(ui::card(
|
||||||
@@ -355,7 +375,7 @@ fn general(_app: &App, p: Paint, _kit: &rune_kit::Kit, _layer: &mut Vec<El>, con
|
|||||||
p,
|
p,
|
||||||
"autostart",
|
"autostart",
|
||||||
"Launch League Recorder at startup",
|
"Launch League Recorder at startup",
|
||||||
_app.autostart,
|
app.autostart,
|
||||||
|app: &mut App| {
|
|app: &mut App| {
|
||||||
let next = !app.autostart;
|
let next = !app.autostart;
|
||||||
match crate::os::set_autostart(next) {
|
match crate::os::set_autostart(next) {
|
||||||
@@ -372,31 +392,49 @@ fn general(_app: &App, p: Paint, _kit: &rune_kit::Kit, _layer: &mut Vec<El>, con
|
|||||||
},
|
},
|
||||||
)],
|
)],
|
||||||
))
|
))
|
||||||
.child(
|
.child(ui::card(
|
||||||
row()
|
p,
|
||||||
.key("general-actions")
|
Some("Files"),
|
||||||
.gap(8.0)
|
vec![
|
||||||
.center_y()
|
ui::setting_row(
|
||||||
.child(ui::button(
|
|
||||||
p,
|
p,
|
||||||
"open-recordings",
|
"recordings-folder",
|
||||||
"Open recordings folder",
|
"Recordings folder",
|
||||||
false,
|
text(short_path(&app.form.draft.output.path))
|
||||||
|_app: &mut App| {
|
.key("path")
|
||||||
crate::daemon::open_folder(&crate::daemon::recordings_dir());
|
.font(body(12.0))
|
||||||
},
|
.color(p.muted()),
|
||||||
))
|
),
|
||||||
.child(ui::button(
|
row()
|
||||||
p,
|
.key("files-actions")
|
||||||
"reset-settings",
|
.px(space::S3)
|
||||||
"Reset to defaults",
|
.pb(space::S2)
|
||||||
false,
|
.child(ui::button(
|
||||||
|app: &mut App| {
|
p,
|
||||||
app.daemon.reset_settings();
|
"open-recordings",
|
||||||
},
|
"Open folder",
|
||||||
)),
|
false,
|
||||||
)
|
|_app: &mut App| {
|
||||||
|
crate::daemon::open_folder(&crate::daemon::recordings_dir());
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A path as it fits on a row: the last two segments, with the rest elided.
|
||||||
|
/// A path as it fits on a row: the last two segments, with the rest elided.
|
||||||
|
fn short_path(path: &str) -> String {
|
||||||
|
let sep = std::path::MAIN_SEPARATOR;
|
||||||
|
let normalized = path.replace(sep, "/");
|
||||||
|
let parts: Vec<&str> = normalized.split('/').filter(|p| !p.is_empty()).collect();
|
||||||
|
match parts.len() {
|
||||||
|
0 => path.to_string(),
|
||||||
|
1 | 2 => parts.join(&sep.to_string()),
|
||||||
|
n => format!("…{sep}{}{sep}{}", parts[n - 2], parts[n - 1]),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content: El) -> El {
|
fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content: El) -> El {
|
||||||
let v = &app.form.draft.video;
|
let v = &app.form.draft.video;
|
||||||
let o = &app.form.draft.output;
|
let o = &app.form.draft.output;
|
||||||
@@ -443,7 +481,6 @@ fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, cont
|
|||||||
),
|
),
|
||||||
text_row(
|
text_row(
|
||||||
p,
|
p,
|
||||||
kit,
|
|
||||||
"frame-rate",
|
"frame-rate",
|
||||||
"Frame rate",
|
"Frame rate",
|
||||||
"Frames per second the daemon records",
|
"Frames per second the daemon records",
|
||||||
@@ -480,7 +517,6 @@ fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, cont
|
|||||||
vec![
|
vec![
|
||||||
text_row(
|
text_row(
|
||||||
p,
|
p,
|
||||||
kit,
|
|
||||||
"output-path",
|
"output-path",
|
||||||
"Folder",
|
"Folder",
|
||||||
"Where finished recordings are written",
|
"Where finished recordings are written",
|
||||||
@@ -489,7 +525,6 @@ fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, cont
|
|||||||
),
|
),
|
||||||
text_row(
|
text_row(
|
||||||
p,
|
p,
|
||||||
kit,
|
|
||||||
"naming",
|
"naming",
|
||||||
"File name",
|
"File name",
|
||||||
"{date}, {time}, {champion} and {queue_type} are filled in",
|
"{date}, {time}, {champion} and {queue_type} are filled in",
|
||||||
@@ -509,7 +544,6 @@ fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, cont
|
|||||||
),
|
),
|
||||||
text_row(
|
text_row(
|
||||||
p,
|
p,
|
||||||
kit,
|
|
||||||
"split-size",
|
"split-size",
|
||||||
"Split at size",
|
"Split at size",
|
||||||
"Start a new file past this many MB (0 for never)",
|
"Start a new file past this many MB (0 for never)",
|
||||||
@@ -518,7 +552,6 @@ fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, cont
|
|||||||
),
|
),
|
||||||
text_row(
|
text_row(
|
||||||
p,
|
p,
|
||||||
kit,
|
|
||||||
"split-time",
|
"split-time",
|
||||||
"Split at time",
|
"Split at time",
|
||||||
"Start a new file after this many minutes (0 for never)",
|
"Start a new file after this many minutes (0 for never)",
|
||||||
@@ -538,59 +571,63 @@ fn recording(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, cont
|
|||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn audio(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content: El) -> El {
|
/// The microphone picker: the system default plus every input device the daemon reports.
|
||||||
let a = &app.form.draft.audio;
|
fn mic_row(p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, app: &App, key: &'static str) -> El {
|
||||||
let mic_name = a
|
let devices = &app.devices.input_devices;
|
||||||
|
let current = app
|
||||||
|
.form
|
||||||
|
.draft
|
||||||
|
.audio
|
||||||
.mic_device
|
.mic_device
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|id| app.devices.input_devices.iter().find(|d| &d.id == id))
|
.and_then(|id| devices.iter().find(|d| &d.id == id))
|
||||||
.map(|d| d.name.clone())
|
.map(|d| d.name.clone())
|
||||||
.or_else(|| {
|
.unwrap_or_else(|| "System default".to_string());
|
||||||
app.devices
|
let mut options = vec!["System default".to_string()];
|
||||||
.input_devices
|
options.extend(devices.iter().map(|d| d.name.clone()));
|
||||||
.iter()
|
let names: Vec<&str> = options.iter().map(String::as_str).collect();
|
||||||
.find(|d| d.is_default)
|
let open = app.form.open_select == Some(key);
|
||||||
.map(|d| d.name.clone())
|
let select = Select::new(key, &names)
|
||||||
});
|
.current(Some(¤t))
|
||||||
let mic_options: Vec<String> = app
|
|
||||||
.devices
|
|
||||||
.input_devices
|
|
||||||
.iter()
|
|
||||||
.map(|d| d.name.clone())
|
|
||||||
.collect();
|
|
||||||
let mic_refs: Vec<&str> = mic_options.iter().map(String::as_str).collect();
|
|
||||||
let open = app.form.open_select == Some("mic-device");
|
|
||||||
let mic_select = Select::new("mic-device", &mic_refs)
|
|
||||||
.current(mic_name.as_deref())
|
|
||||||
.open(open)
|
.open(open)
|
||||||
.label("Microphone")
|
.label("Microphone")
|
||||||
.width(220.0)
|
.width(220.0)
|
||||||
.on_toggle(|app: &mut App| {
|
.on_toggle(move |app: &mut App| {
|
||||||
app.form.open_select = if app.form.open_select == Some("mic-device") {
|
app.form.open_select = if app.form.open_select == Some(key) {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some("mic-device")
|
Some(key)
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.on_close(|app: &mut App| app.form.open_select = None)
|
.on_close(|app: &mut App| app.form.open_select = None)
|
||||||
.on_choose(|app: &mut App, value: &str, _: &mut rune::Tx| {
|
.on_choose(|app: &mut App, value: &str, _: &mut rune::Tx| {
|
||||||
let id = app
|
app.form.draft.audio.mic_device = if value == "System default" {
|
||||||
.devices
|
None
|
||||||
.input_devices
|
} else {
|
||||||
.iter()
|
app.devices
|
||||||
.find(|d| d.name == value)
|
.input_devices
|
||||||
.map(|d| d.id.clone())
|
.iter()
|
||||||
.unwrap_or_else(|| value.to_string());
|
.find(|d| d.name == value)
|
||||||
app.form.draft.audio.mic_device = Some(id);
|
.map(|d| d.id.clone())
|
||||||
|
};
|
||||||
app.form.dirty = true;
|
app.form.dirty = true;
|
||||||
app.form.open_select = None;
|
app.form.open_select = None;
|
||||||
})
|
})
|
||||||
.build(kit, layer);
|
.build(kit, layer);
|
||||||
|
let hint = match devices.iter().find(|d| d.is_default) {
|
||||||
|
_ if devices.is_empty() => "The recorder sees no microphone".to_string(),
|
||||||
|
Some(d) => format!("System default is {}", d.name),
|
||||||
|
None => "What the recorder captures when the microphone is on".to_string(),
|
||||||
|
};
|
||||||
|
ui::setting_row_with(p, key, "Microphone", &hint, select)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn audio(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content: El) -> El {
|
||||||
|
let a = &app.form.draft.audio;
|
||||||
let mut sources = col().key("sources").gap(2.0);
|
let mut sources = col().key("sources").gap(2.0);
|
||||||
if a.capture_apps.is_empty() {
|
if a.capture_apps.is_empty() {
|
||||||
sources = sources.child(
|
sources = sources.child(
|
||||||
text("No application sources yet.")
|
text("No applications yet. Add one below and its audio joins the clip.")
|
||||||
.key("sources-empty")
|
.key("sources-empty")
|
||||||
.font(body(12.0))
|
.font(body(12.0))
|
||||||
.color(p.muted())
|
.color(p.muted())
|
||||||
@@ -670,47 +707,12 @@ fn audio(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content:
|
|||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let source_type = app.form.source_type;
|
|
||||||
content
|
content
|
||||||
.child(ui::card(
|
.child(ui::card(
|
||||||
p,
|
p,
|
||||||
Some("Audio"),
|
Some("Levels"),
|
||||||
vec![
|
vec![
|
||||||
ui::toggle_row(
|
|
||||||
p,
|
|
||||||
"audio-enabled",
|
|
||||||
"Record audio",
|
|
||||||
a.enabled,
|
|
||||||
|app: &mut App| {
|
|
||||||
app.form.draft.audio.enabled ^= true;
|
|
||||||
app.form.dirty = true;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
text_row(
|
|
||||||
p,
|
|
||||||
kit,
|
|
||||||
"audio-bitrate",
|
|
||||||
"Bitrate",
|
|
||||||
"Audio bitrate in kbps",
|
|
||||||
&app.form.bitrate,
|
|
||||||
|app| &mut app.form.bitrate,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
))
|
|
||||||
.child(ui::card(
|
|
||||||
p,
|
|
||||||
Some("Game audio"),
|
|
||||||
vec![
|
|
||||||
ui::toggle_row(
|
|
||||||
p,
|
|
||||||
"capture-game",
|
|
||||||
"Capture desktop audio",
|
|
||||||
a.capture_game,
|
|
||||||
|app: &mut App| {
|
|
||||||
app.form.draft.audio.capture_game ^= true;
|
|
||||||
app.form.dirty = true;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ui::setting_row(
|
ui::setting_row(
|
||||||
p,
|
p,
|
||||||
"game-volume",
|
"game-volume",
|
||||||
@@ -720,12 +722,42 @@ fn audio(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content:
|
|||||||
"game-volume",
|
"game-volume",
|
||||||
"Game volume",
|
"Game volume",
|
||||||
a.game_volume,
|
a.game_volume,
|
||||||
|app: &mut App, value| {
|
|app, value| {
|
||||||
app.form.draft.audio.game_volume = value;
|
app.form.draft.audio.game_volume = value;
|
||||||
app.form.dirty = true;
|
app.form.dirty = true;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
ui::setting_row(
|
||||||
|
p,
|
||||||
|
"mic-volume",
|
||||||
|
"Microphone volume",
|
||||||
|
ui::slider(
|
||||||
|
p,
|
||||||
|
"mic-volume",
|
||||||
|
"Microphone volume",
|
||||||
|
a.mic_volume,
|
||||||
|
|app, value| {
|
||||||
|
app.form.draft.audio.mic_volume = value;
|
||||||
|
app.form.dirty = true;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ui::setting_row(
|
||||||
|
p,
|
||||||
|
"apps-volume",
|
||||||
|
"Applications volume",
|
||||||
|
ui::slider(
|
||||||
|
p,
|
||||||
|
"apps-volume",
|
||||||
|
"Applications volume",
|
||||||
|
a.apps_volume,
|
||||||
|
|app, value| {
|
||||||
|
app.form.draft.audio.apps_volume = value;
|
||||||
|
app.form.dirty = true;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
.child(ui::card(
|
.child(ui::card(
|
||||||
@@ -742,133 +774,117 @@ fn audio(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content:
|
|||||||
app.form.dirty = true;
|
app.form.dirty = true;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ui::setting_row_with(
|
mic_row(p, kit, layer, app, "mic-device"),
|
||||||
p,
|
|
||||||
"mic-device",
|
|
||||||
"Device",
|
|
||||||
"The microphone the daemon records",
|
|
||||||
mic_select,
|
|
||||||
),
|
|
||||||
ui::setting_row(
|
|
||||||
p,
|
|
||||||
"mic-volume",
|
|
||||||
"Microphone volume",
|
|
||||||
ui::slider(
|
|
||||||
p,
|
|
||||||
"mic-volume",
|
|
||||||
"Microphone volume",
|
|
||||||
a.mic_volume,
|
|
||||||
|app: &mut App, value| {
|
|
||||||
app.form.draft.audio.mic_volume = value;
|
|
||||||
app.form.dirty = true;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
.child(ui::card(
|
.child(ui::card(
|
||||||
p,
|
p,
|
||||||
Some("Applications"),
|
Some("Applications"),
|
||||||
vec![
|
vec![sources, add_source(app, p, kit, layer)],
|
||||||
ui::setting_row(
|
|
||||||
p,
|
|
||||||
"apps-volume",
|
|
||||||
"Application volume",
|
|
||||||
ui::slider(
|
|
||||||
p,
|
|
||||||
"apps-volume",
|
|
||||||
"Application volume",
|
|
||||||
a.apps_volume,
|
|
||||||
|app: &mut App, value| {
|
|
||||||
app.form.draft.audio.apps_volume = value;
|
|
||||||
app.form.dirty = true;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
sources,
|
|
||||||
text(format!(
|
|
||||||
"{} output devices are visible to the daemon.",
|
|
||||||
app.devices.output_devices.len()
|
|
||||||
))
|
|
||||||
.key("output-devices")
|
|
||||||
.font(body(11.0))
|
|
||||||
.color(p.muted())
|
|
||||||
.ml(space::S3)
|
|
||||||
.pb(space::S2),
|
|
||||||
],
|
|
||||||
))
|
|
||||||
.child(ui::card(
|
|
||||||
p,
|
|
||||||
Some("Add an application"),
|
|
||||||
vec![
|
|
||||||
text_row(
|
|
||||||
p,
|
|
||||||
kit,
|
|
||||||
"source-name",
|
|
||||||
"Name",
|
|
||||||
"What the source is called in this list",
|
|
||||||
&app.form.source_name,
|
|
||||||
|app| &mut app.form.source_name,
|
|
||||||
),
|
|
||||||
text_row(
|
|
||||||
p,
|
|
||||||
kit,
|
|
||||||
"source-device",
|
|
||||||
"Process or device",
|
|
||||||
"Discord.exe for an application, or a device id",
|
|
||||||
&app.form.source_device,
|
|
||||||
|app| &mut app.form.source_device,
|
|
||||||
),
|
|
||||||
select_row(
|
|
||||||
p,
|
|
||||||
kit,
|
|
||||||
layer,
|
|
||||||
"source-type",
|
|
||||||
"Type",
|
|
||||||
"Application audio, an output device or an input device",
|
|
||||||
&SOURCE_TYPES,
|
|
||||||
Some(source_type.label().to_string()),
|
|
||||||
app,
|
|
||||||
),
|
|
||||||
row()
|
|
||||||
.key("add-source")
|
|
||||||
.px(space::S3)
|
|
||||||
.pb(space::S2)
|
|
||||||
.child(ui::button(
|
|
||||||
p,
|
|
||||||
"add-source-button",
|
|
||||||
"Add source",
|
|
||||||
true,
|
|
||||||
|app: &mut App| {
|
|
||||||
let name = app.form.source_name.text.trim().to_string();
|
|
||||||
let device = app.form.source_device.text.trim().to_string();
|
|
||||||
if name.is_empty() || device.is_empty() {
|
|
||||||
app.notify_error(
|
|
||||||
"An audio source needs a name and a process or device",
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let source = AudioSource {
|
|
||||||
id: String::new(),
|
|
||||||
name,
|
|
||||||
source_type: app.form.source_type,
|
|
||||||
device,
|
|
||||||
enabled: true,
|
|
||||||
volume: None,
|
|
||||||
};
|
|
||||||
match serde_json::to_value(&source) {
|
|
||||||
Ok(value) => app.daemon.add_audio_source(value),
|
|
||||||
Err(e) => {
|
|
||||||
app.notify_error(format!("audio source did not serialize: {e}"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn daemon_tab(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content: El) -> El {
|
/// The row that adds an application source: a name, the process or device, and its kind.
|
||||||
|
fn add_source(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>) -> El {
|
||||||
|
let open = app.form.open_select == Some("source-type");
|
||||||
|
let kind = Select::new("source-type", &SOURCE_TYPES)
|
||||||
|
.current(Some(app.form.source_type.label()))
|
||||||
|
.open(open)
|
||||||
|
.label("Type")
|
||||||
|
.width(170.0)
|
||||||
|
.on_toggle(|app: &mut App| {
|
||||||
|
app.form.open_select = if app.form.open_select == Some("source-type") {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some("source-type")
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.on_close(|app: &mut App| app.form.open_select = None)
|
||||||
|
.on_choose(|app: &mut App, value: &str, _: &mut rune::Tx| {
|
||||||
|
app.form.choose("source-type", value);
|
||||||
|
app.form.open_select = None;
|
||||||
|
})
|
||||||
|
.build(kit, layer);
|
||||||
|
col()
|
||||||
|
.key("add-source")
|
||||||
|
.gap(space::S2)
|
||||||
|
.px(space::S3)
|
||||||
|
.pb(space::S3)
|
||||||
|
.child(
|
||||||
|
text("Add an application")
|
||||||
|
.key("add-title")
|
||||||
|
.font(type_::SECTION)
|
||||||
|
.color(p.muted()),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
row()
|
||||||
|
.key("add-fields")
|
||||||
|
.gap(space::S3)
|
||||||
|
.center_y()
|
||||||
|
.child(labelled_field(
|
||||||
|
p,
|
||||||
|
"Name",
|
||||||
|
"source-name",
|
||||||
|
&app.form.source_name,
|
||||||
|
|app| &mut app.form.source_name,
|
||||||
|
))
|
||||||
|
.child(labelled_field(
|
||||||
|
p,
|
||||||
|
"Process or device",
|
||||||
|
"source-device",
|
||||||
|
&app.form.source_device,
|
||||||
|
|app| &mut app.form.source_device,
|
||||||
|
))
|
||||||
|
.child(kind)
|
||||||
|
.child(ui::button(
|
||||||
|
p,
|
||||||
|
"add-source-button",
|
||||||
|
"Add",
|
||||||
|
true,
|
||||||
|
|app: &mut App| {
|
||||||
|
let name = app.form.source_name.text.trim().to_string();
|
||||||
|
let device = app.form.source_device.text.trim().to_string();
|
||||||
|
if name.is_empty() || device.is_empty() {
|
||||||
|
app.notify_error(
|
||||||
|
"An audio source needs a name and a process or device",
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let source = AudioSource {
|
||||||
|
id: String::new(),
|
||||||
|
name,
|
||||||
|
source_type: app.form.source_type,
|
||||||
|
device,
|
||||||
|
enabled: true,
|
||||||
|
volume: None,
|
||||||
|
};
|
||||||
|
match serde_json::to_value(&source) {
|
||||||
|
Ok(value) => app.daemon.add_audio_source(value),
|
||||||
|
Err(e) => {
|
||||||
|
app.notify_error(format!("audio source did not serialize: {e}"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A field with its name above it, for a row of controls that has no room for setting labels.
|
||||||
|
fn labelled_field(
|
||||||
|
p: Paint,
|
||||||
|
label: &'static str,
|
||||||
|
key: &'static str,
|
||||||
|
edit: &TextEdit,
|
||||||
|
to: fn(&mut App) -> &mut TextEdit,
|
||||||
|
) -> El {
|
||||||
|
col()
|
||||||
|
.key(key)
|
||||||
|
.gap(space::S1)
|
||||||
|
.child(text(label).key("caption").font(body(11.0)).color(p.muted()))
|
||||||
|
.child(ui::text_field(p, key, label, edit, to))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn advanced(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, content: El) -> El {
|
||||||
let status_row = |key: &str, label: &'static str, value: String| {
|
let status_row = |key: &str, label: &'static str, value: String| {
|
||||||
row()
|
row()
|
||||||
.key(key)
|
.key(key)
|
||||||
@@ -919,7 +935,11 @@ fn daemon_tab(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, con
|
|||||||
.map(|id| id.to_string())
|
.map(|id| id.to_string())
|
||||||
.unwrap_or_else(|| "none".into()),
|
.unwrap_or_else(|| "none".into()),
|
||||||
),
|
),
|
||||||
status_row("daemon-log", "Log file", crate::daemon::log_path()),
|
status_row(
|
||||||
|
"daemon-log",
|
||||||
|
"Log file",
|
||||||
|
short_path(&crate::daemon::log_path()),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
.child(ui::card(
|
.child(ui::card(
|
||||||
@@ -928,7 +948,6 @@ fn daemon_tab(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, con
|
|||||||
vec![
|
vec![
|
||||||
text_row(
|
text_row(
|
||||||
p,
|
p,
|
||||||
kit,
|
|
||||||
"poll-interval",
|
"poll-interval",
|
||||||
"Client poll interval",
|
"Client poll interval",
|
||||||
"How often the recorder checks the League Client, in milliseconds",
|
"How often the recorder checks the League Client, in milliseconds",
|
||||||
@@ -948,6 +967,29 @@ fn daemon_tab(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, con
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
|
.child(ui::card(
|
||||||
|
p,
|
||||||
|
Some("Audio"),
|
||||||
|
vec![
|
||||||
|
status_row(
|
||||||
|
"audio-devices",
|
||||||
|
"Devices",
|
||||||
|
format!(
|
||||||
|
"{} in · {} out",
|
||||||
|
app.devices.input_devices.len(),
|
||||||
|
app.devices.output_devices.len()
|
||||||
|
),
|
||||||
|
),
|
||||||
|
text_row(
|
||||||
|
p,
|
||||||
|
"audio-bitrate",
|
||||||
|
"Bitrate",
|
||||||
|
"Audio bitrate in kbps",
|
||||||
|
&app.form.bitrate,
|
||||||
|
|app| &mut app.form.bitrate,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
))
|
||||||
.child(
|
.child(
|
||||||
row()
|
row()
|
||||||
.key("daemon-actions")
|
.key("daemon-actions")
|
||||||
@@ -979,6 +1021,15 @@ fn daemon_tab(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec<El>, con
|
|||||||
|app: &mut App| {
|
|app: &mut App| {
|
||||||
app.daemon.shutdown();
|
app.daemon.shutdown();
|
||||||
},
|
},
|
||||||
|
))
|
||||||
|
.child(ui::button(
|
||||||
|
p,
|
||||||
|
"reset-settings",
|
||||||
|
"Reset to defaults",
|
||||||
|
false,
|
||||||
|
|app: &mut App| {
|
||||||
|
app.daemon.reset_settings();
|
||||||
|
},
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
.child(ui::card(
|
.child(ui::card(
|
||||||
|
|||||||
@@ -0,0 +1,155 @@
|
|||||||
|
//! The app's palette.
|
||||||
|
//!
|
||||||
|
//! One shell colour scheme: near-black surfaces tinted blue, brass for what the user acts on,
|
||||||
|
//! and mint or coral only for results. Champion art and victory banners are the loudest things
|
||||||
|
//! on screen, so the chrome around them stays quiet.
|
||||||
|
//!
|
||||||
|
//! Every colour is OKLCH, written as lightness, chroma and hue. The two appearances share the
|
||||||
|
//! hues and swap lightness, so a control keeps its identity in light mode.
|
||||||
|
|
||||||
|
use rune::tok::Theme;
|
||||||
|
use rune::{Color, oklch, oklcha};
|
||||||
|
|
||||||
|
/// Hues, one per role. Neutrals take a touch of the shell's blue; text keeps the same cast.
|
||||||
|
const SHELL: f32 = 268.0;
|
||||||
|
const BRASS: f32 = 84.0;
|
||||||
|
const MINT: f32 = 157.0;
|
||||||
|
const CORAL: f32 = 22.0;
|
||||||
|
|
||||||
|
pub struct Palette {
|
||||||
|
/// Surfaces and ink: what rune's widgets read.
|
||||||
|
pub theme: Theme,
|
||||||
|
/// The window chrome: title bar and status bar, a step above or below the page.
|
||||||
|
pub chrome: Color,
|
||||||
|
/// A field's well, sunk into the card it sits in.
|
||||||
|
pub field: Color,
|
||||||
|
/// What the user acts on: primary buttons, sliders, the selected tab.
|
||||||
|
pub accent: Color,
|
||||||
|
/// Ink for text on an accent fill.
|
||||||
|
pub accent_ink: Color,
|
||||||
|
pub success: Color,
|
||||||
|
pub danger: Color,
|
||||||
|
pub warning: Color,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn palette(dark: bool) -> Palette {
|
||||||
|
if dark {
|
||||||
|
Palette {
|
||||||
|
theme: Theme {
|
||||||
|
bg: oklch(0.168, 0.012, SHELL),
|
||||||
|
card: oklch(0.212, 0.014, SHELL),
|
||||||
|
card_border: oklcha(1.0, 0.0, 0.0, 0.055),
|
||||||
|
text: oklch(0.962, 0.003, SHELL),
|
||||||
|
text_secondary: oklch(0.734, 0.012, SHELL),
|
||||||
|
separator: oklcha(1.0, 0.0, 0.0, 0.05),
|
||||||
|
control_track: oklcha(1.0, 0.0, 0.0, 0.045),
|
||||||
|
control_off: oklcha(1.0, 0.0, 0.0, 0.09),
|
||||||
|
indicator: oklch(0.44, 0.01, SHELL),
|
||||||
|
knob: oklch(0.985, 0.0, 0.0),
|
||||||
|
hover: oklcha(1.0, 0.0, 0.0, 0.018),
|
||||||
|
press: oklcha(1.0, 0.0, 0.0, 0.035),
|
||||||
|
shadow: oklcha(0.0, 0.0, 0.0, 0.45),
|
||||||
|
shadow_soft: oklcha(0.0, 0.0, 0.0, 0.3),
|
||||||
|
edge: oklcha(0.0, 0.0, 0.0, 0.32),
|
||||||
|
knob_shadow: oklcha(0.0, 0.0, 0.0, 0.32),
|
||||||
|
},
|
||||||
|
chrome: oklch(0.192, 0.013, SHELL),
|
||||||
|
field: oklch(0.178, 0.012, SHELL),
|
||||||
|
accent: oklch(0.818, 0.116, BRASS),
|
||||||
|
accent_ink: oklch(0.245, 0.035, BRASS),
|
||||||
|
success: oklch(0.782, 0.132, MINT),
|
||||||
|
danger: oklch(0.706, 0.152, CORAL),
|
||||||
|
warning: oklch(0.812, 0.115, 72.0),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Palette {
|
||||||
|
theme: Theme {
|
||||||
|
bg: oklch(0.966, 0.004, SHELL),
|
||||||
|
card: oklch(1.0, 0.0, 0.0),
|
||||||
|
card_border: oklcha(0.2, 0.02, SHELL, 0.1),
|
||||||
|
text: oklch(0.235, 0.012, SHELL),
|
||||||
|
text_secondary: oklch(0.515, 0.013, SHELL),
|
||||||
|
separator: oklcha(0.2, 0.02, SHELL, 0.12),
|
||||||
|
control_track: oklcha(0.2, 0.01, SHELL, 0.13),
|
||||||
|
control_off: oklcha(0.2, 0.01, SHELL, 0.22),
|
||||||
|
indicator: oklch(1.0, 0.0, 0.0),
|
||||||
|
knob: oklch(1.0, 0.0, 0.0),
|
||||||
|
hover: oklcha(0.2, 0.01, SHELL, 0.06),
|
||||||
|
press: oklcha(0.2, 0.01, SHELL, 0.11),
|
||||||
|
shadow: oklcha(0.2, 0.02, SHELL, 0.16),
|
||||||
|
shadow_soft: oklcha(0.2, 0.02, SHELL, 0.07),
|
||||||
|
edge: oklcha(0.2, 0.02, SHELL, 0.2),
|
||||||
|
knob_shadow: oklcha(0.2, 0.02, SHELL, 0.3),
|
||||||
|
},
|
||||||
|
chrome: oklch(0.988, 0.003, SHELL),
|
||||||
|
field: oklch(0.955, 0.004, SHELL),
|
||||||
|
accent: oklch(0.535, 0.104, 74.0),
|
||||||
|
accent_ink: oklch(1.0, 0.0, 0.0),
|
||||||
|
success: oklch(0.512, 0.122, MINT),
|
||||||
|
danger: oklch(0.55, 0.165, CORAL),
|
||||||
|
warning: oklch(0.52, 0.112, 68.0),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
/// Relative luminance of a linear-light colour, as WCAG defines contrast.
|
||||||
|
fn luminance(c: Color) -> f64 {
|
||||||
|
0.2126 * c.r as f64 + 0.7152 * c.g as f64 + 0.0722 * c.b as f64
|
||||||
|
}
|
||||||
|
|
||||||
|
fn contrast(a: Color, b: Color) -> f64 {
|
||||||
|
let (x, y) = (luminance(a), luminance(b));
|
||||||
|
let (hi, lo) = if x > y { (x, y) } else { (y, x) };
|
||||||
|
(hi + 0.05) / (lo + 0.05)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Every colour that carries text keeps WCAG AA (4.5:1) on the surfaces it is drawn on,
|
||||||
|
/// in both appearances. The palette is tuned by hand, so this is the guard that a nudge
|
||||||
|
/// to one number did not make a label unreadable.
|
||||||
|
#[test]
|
||||||
|
fn ink_reads_on_the_surfaces() {
|
||||||
|
for dark in [true, false] {
|
||||||
|
let p = palette(dark);
|
||||||
|
let mode = if dark { "dark" } else { "light" };
|
||||||
|
for (name, ink) in [
|
||||||
|
("text", p.theme.text),
|
||||||
|
("text_secondary", p.theme.text_secondary),
|
||||||
|
("accent", p.accent),
|
||||||
|
("success", p.success),
|
||||||
|
("danger", p.danger),
|
||||||
|
("warning", p.warning),
|
||||||
|
] {
|
||||||
|
for (surface, bg) in [
|
||||||
|
("bg", p.theme.bg),
|
||||||
|
("card", p.theme.card),
|
||||||
|
("chrome", p.chrome),
|
||||||
|
] {
|
||||||
|
let ratio = contrast(ink, bg);
|
||||||
|
assert!(
|
||||||
|
ratio >= 4.5,
|
||||||
|
"{mode}: {name} on {surface} is {ratio:.2}:1, under 4.5:1"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let ratio = contrast(p.accent, p.accent_ink);
|
||||||
|
assert!(
|
||||||
|
ratio >= 4.5,
|
||||||
|
"{mode}: accent_ink on accent is {ratio:.2}:1, under 4.5:1"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A field's well has to be visible inside the card it sits in.
|
||||||
|
#[test]
|
||||||
|
fn the_field_well_stands_out_from_the_card() {
|
||||||
|
for dark in [true, false] {
|
||||||
|
let p = palette(dark);
|
||||||
|
let ratio = contrast(p.field, p.theme.card);
|
||||||
|
assert!(ratio >= 1.04, "{dark}: field vs card is {ratio:.2}:1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+67
-16
@@ -1,6 +1,6 @@
|
|||||||
//! Shared colours and small controls for the screens.
|
//! Shared colours and small controls for the screens.
|
||||||
|
|
||||||
use rune::tok::{self, Theme, motion, radius, space, type_};
|
use rune::tok::{Theme, motion, radius, space, type_};
|
||||||
use rune::{Color, Drag, El, Phase, TextStyle, col, el, row, text};
|
use rune::{Color, Drag, El, Phase, TextStyle, col, el, row, text};
|
||||||
|
|
||||||
use crate::app::App;
|
use crate::app::App;
|
||||||
@@ -9,17 +9,28 @@ use crate::app::App;
|
|||||||
pub struct Paint {
|
pub struct Paint {
|
||||||
pub t: Theme,
|
pub t: Theme,
|
||||||
pub accent: Color,
|
pub accent: Color,
|
||||||
pub dark: bool,
|
pub accent_ink: Color,
|
||||||
|
pub success: Color,
|
||||||
|
pub danger: Color,
|
||||||
|
pub warning: Color,
|
||||||
|
pub chrome: Color,
|
||||||
|
pub field: Color,
|
||||||
pub hair: f32,
|
pub hair: f32,
|
||||||
pub scale: f32,
|
pub scale: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Paint {
|
impl Paint {
|
||||||
pub fn new(dark: bool, scale: f32) -> Self {
|
pub fn new(dark: bool, scale: f32) -> Self {
|
||||||
|
let palette = crate::theme::palette(dark);
|
||||||
Self {
|
Self {
|
||||||
t: tok::theme(dark),
|
t: palette.theme,
|
||||||
accent: tok::accent(0, dark),
|
accent: palette.accent,
|
||||||
dark,
|
accent_ink: palette.accent_ink,
|
||||||
|
success: palette.success,
|
||||||
|
danger: palette.danger,
|
||||||
|
warning: palette.warning,
|
||||||
|
chrome: palette.chrome,
|
||||||
|
field: palette.field,
|
||||||
hair: 1.0 / scale,
|
hair: 1.0 / scale,
|
||||||
scale,
|
scale,
|
||||||
}
|
}
|
||||||
@@ -28,14 +39,6 @@ impl Paint {
|
|||||||
pub fn muted(&self) -> Color {
|
pub fn muted(&self) -> Color {
|
||||||
self.t.text_secondary
|
self.t.text_secondary
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn danger(&self) -> Color {
|
|
||||||
tok::accent(2, self.dark)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn success(&self) -> Color {
|
|
||||||
tok::accent(4, self.dark)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn heading(size: f32) -> TextStyle {
|
pub fn heading(size: f32) -> TextStyle {
|
||||||
@@ -272,6 +275,46 @@ pub fn slider(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A one-line text field for a settings row. The text sits at the row's end edge, like every
|
||||||
|
/// other control, so values start and end on one line down the card.
|
||||||
|
pub fn text_field(
|
||||||
|
p: Paint,
|
||||||
|
key: &'static str,
|
||||||
|
label: &str,
|
||||||
|
edit: &rune::TextEdit,
|
||||||
|
to: fn(&mut App) -> &mut rune::TextEdit,
|
||||||
|
) -> El {
|
||||||
|
let focused = edit.focused;
|
||||||
|
row()
|
||||||
|
.key(key)
|
||||||
|
.h(28.0)
|
||||||
|
.w(220.0)
|
||||||
|
.px(8.0)
|
||||||
|
.center_y()
|
||||||
|
.radius(radius::MD)
|
||||||
|
.fill(p.field)
|
||||||
|
.border(
|
||||||
|
p.hair,
|
||||||
|
if focused {
|
||||||
|
p.accent.alpha(0.7)
|
||||||
|
} else {
|
||||||
|
p.t.card_border
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
rune::text_input(edit, type_::BODY)
|
||||||
|
.key("input")
|
||||||
|
.single_line()
|
||||||
|
.w_full()
|
||||||
|
.label(label)
|
||||||
|
.color(p.t.text)
|
||||||
|
.align(rune::Align::End)
|
||||||
|
.caret(p.t.text, p.accent.alpha(0.3))
|
||||||
|
.on_edit(to)
|
||||||
|
.on_input_change(|app: &mut App, _| app.form.dirty = true),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/// A pill tab; the selected one fills with the accent.
|
/// A pill tab; the selected one fills with the accent.
|
||||||
pub fn tab(
|
pub fn tab(
|
||||||
p: Paint,
|
p: Paint,
|
||||||
@@ -285,15 +328,23 @@ pub fn tab(
|
|||||||
.label(label)
|
.label(label)
|
||||||
.checked(selected)
|
.checked(selected)
|
||||||
.focusable(true)
|
.focusable(true)
|
||||||
.px(14.0)
|
.px(18.0)
|
||||||
.h(28.0)
|
.h(28.0)
|
||||||
.center()
|
.center()
|
||||||
.radius(radius::MD)
|
.radius(radius::MD)
|
||||||
.fill(if selected {
|
.fill(if selected {
|
||||||
p.accent.alpha(0.16)
|
p.accent.alpha(0.22)
|
||||||
} else {
|
} else {
|
||||||
Color::TRANSPARENT
|
Color::TRANSPARENT
|
||||||
})
|
})
|
||||||
|
.border(
|
||||||
|
p.hair,
|
||||||
|
if selected {
|
||||||
|
p.accent.alpha(0.32)
|
||||||
|
} else {
|
||||||
|
Color::TRANSPARENT
|
||||||
|
},
|
||||||
|
)
|
||||||
.hover(p.t.hover)
|
.hover(p.t.hover)
|
||||||
.press(p.t.press)
|
.press(p.t.press)
|
||||||
.on_press(on_press)
|
.on_press(on_press)
|
||||||
@@ -334,7 +385,7 @@ pub fn button(
|
|||||||
text(label)
|
text(label)
|
||||||
.key("label")
|
.key("label")
|
||||||
.font(type_::LABEL)
|
.font(type_::LABEL)
|
||||||
.color(if primary { Color::WHITE } else { p.t.text })
|
.color(if primary { p.accent_ink } else { p.t.text })
|
||||||
.a11y_hidden(),
|
.a11y_hidden(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user