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:
vhaudiquet committed 2026-11-16 19:06:36 +01:00
1 parent b82225ce08
commit 3dfef1961d
8 files changed
+628 -368

No files matched your search

+30 -21
View File
@@ -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
/// 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> {
let name = if cfg!(windows) {
"record-daemon.exe"
@@ -49,34 +53,39 @@ pub fn find_binary() -> Option<PathBuf> {
return Some(resources);
}
}
let mut dir = exe_dir.to_path_buf();
for _ in 0..6 {
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;
}
if let Some(found) = newest_build(exe_dir, name) {
return Some(found);
}
}
let cwd = std::env::current_dir().ok()?;
let mut dir = cwd.as_path();
for _ in 0..5 {
for suffix in ["record-daemon/target/release", "record-daemon/target/debug"] {
let candidate = dir.join(suffix).join(name);
if candidate.exists() {
return Some(candidate);
}
newest_build(&std::env::current_dir().ok()?, name)
}
/// The most recently built daemon in a checkout, walking up from `start`.
fn newest_build(start: &Path, name: &str) -> Option<PathBuf> {
let mut dir = start.to_path_buf();
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
}
/// Start the daemon detached, so it outlives the app.
pub fn spawn() -> Result<PathBuf, String> {
let binary = find_binary().ok_or_else(|| {