From cf95089f366622292ba64fdfe9c4b83a5adc32e0 Mon Sep 17 00:00:00 2001 From: Geoffrey Vancoetsem <10533139+geeooff@users.noreply.github.com> Date: Mon, 23 Nov 2026 02:35:47 +0100 Subject: [PATCH] Keep the buttons' symbols monochrome with egui 0.37 egui 0.37 no longer embeds its monochrome emoji fonts by default, so the transport and other symbols fell back to Windows' colour Segoe UI Emoji. Turn on egui's monochrome_emoji_fonts feature (a direct egui dependency at eframe's version), group eframe and egui in Dependabot so a lone eframe bump cannot silently lose it, and test that every symbol the window draws is in the embedded fonts. Two symbols those fonts lack are swapped: the move-up arrow and the codec arrow. Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 4 ++++ CHANGELOG.md | 5 +++++ Cargo.lock | 1 + Cargo.toml | 4 ++++ src/app/mod.rs | 26 ++++++++++++++++++++++++++ src/app/settings.rs | 6 +++--- 6 files changed, 43 insertions(+), 3 deletions(-) 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() {