diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c76d5cc..85984ae 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,6 +11,10 @@ updates: cooldown: default-days: 7 groups: + # eframe and egui move together: egui is a direct dependency only for a feature, and a lone eframe + # bump would build two eguis and silently lose it. Before the other groups, so it wins. + egui: + patterns: ["eframe", "egui"] patches: update-types: [patch] commit-message: diff --git a/CHANGELOG.md b/CHANGELOG.md index cdfdf42..a13ba7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,3 +37,8 @@ refuses a tag without one. - *Copy* puts encoded files on the clipboard, ready to paste into a conversation; *Show* opens their folder. - `install-sendto.ps1` adds the application to Explorer's *Send to* menu. + +### Fixed + +- The buttons' symbols are monochrome again, drawn with the window's own fonts instead of the + system's colour emoji. diff --git a/Cargo.lock b/Cargo.lock index 4051530..f92137f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2924,6 +2924,7 @@ dependencies = [ "cpal", "crossbeam-channel", "eframe", + "egui", "env_logger", "log", "rfd", diff --git a/Cargo.toml b/Cargo.toml index b62a983..94a6335 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,10 @@ anyhow = "1.0.104" cpal = "0.18.2" crossbeam-channel = "0.5.17" eframe = { version = "0.37.0", features = ["persistence"] } +# Only to turn on egui's monochrome symbol fonts (egui 0.37 no longer embeds them by default): the +# buttons' symbols stay monochrome instead of falling back to the system's colour emoji. Same version as +# eframe; Dependabot bumps both together. +egui = { version = "0.37.0", features = ["monochrome_emoji_fonts"] } env_logger = "0.11.11" log = "0.4.34" rfd = "0.17.2" diff --git a/src/app/mod.rs b/src/app/mod.rs index 52c43ea..24a4fa0 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1046,3 +1046,29 @@ impl eframe::App for TranscoderApp { eframe::set_value(storage, PREFERENCES_KEY, &self.prefs); } } + +#[cfg(test)] +mod tests { + use eframe::egui::epaint::text::{FontDefinitions, FontId, Fonts, TextOptions}; + + /// Every symbol the window draws outside plain ASCII. Add one here when a label gains one. + const SYMBOLS: &str = "➕✔✖▶⏹⏶⏮◀⏸⏭🔇🔊➡≈·—…"; + + /// The symbols come from egui's own fonts (the `monochrome_emoji_fonts` feature), not from the + /// system's colour emoji: without a font provider, `has_glyphs` only sees the embedded fonts. + #[test] + fn symbols_are_in_the_embedded_fonts() { + let mut fonts = Fonts::new(TextOptions::default(), FontDefinitions::default()); + let mut fonts = fonts.with_pixels_per_point(1.0); + let missing: Vec = SYMBOLS + .chars() + .filter(|symbol| !fonts.has_glyphs(&FontId::proportional(14.0), &symbol.to_string())) + .map(|symbol| format!("{symbol} (U+{:04X})", symbol as u32)) + .collect(); + assert!( + missing.is_empty(), + "missing from egui's fonts: {}", + missing.join(", ") + ); + } +} diff --git a/src/app/settings.rs b/src/app/settings.rs index 725a79c..d6557dc 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -250,14 +250,14 @@ impl TranscoderApp { ui.label("Codec"); egui::ComboBox::from_id_salt("codec") .selected_text(format!( - "{} → {}", + "{} ➡ {}", list_label(&after.codecs), resolved(&after.codecs) )) .width(220.0) .show_ui(ui, |ui| { for list in &lists { - let text = format!("{} → {}", list_label(list), resolved(list)); + let text = format!("{} ➡ {}", list_label(list), resolved(list)); ui.selectable_value(&mut after.codecs, list.clone(), text); } }) @@ -735,7 +735,7 @@ impl TranscoderApp { )) .weak(), ); - if ui.add_enabled(index > 0, egui::Button::new("▲")).on_hover_text("Move up").clicked() { + if ui.add_enabled(index > 0, egui::Button::new("⏶")).on_hover_text("Move up").clicked() { raise = Some(index); } if ui.add_enabled(count > 1, egui::Button::new("✖")).on_hover_text("Delete").clicked() {