From 5f6ebd83e6273a1fb13535c7b7d0edd06fdbe580 Mon Sep 17 00:00:00 2001 From: Sandeepa Nadahalli <1698507+snadahalli@users.noreply.github.com> Date: Wed, 26 Aug 2026 12:48:36 +0530 Subject: [PATCH] fix(sender): make receiver names readable on the unselected row card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The receiver rows paint a hardcoded dark card — `from_gray(30)` when unselected, a dark blue when selected — but the name label carried no explicit colour, so it inherited the theme's default text colour. eframe follows the system theme and nothing in the app overrides it, so on a Mac in light mode the default is near-black: near-black text on a near-black card, effectively invisible. The selected row escaped only because mid blue gives dark text more contrast than near-black does, which is why the bug reads as "only the unselected ones are broken". Pair the fill and the text colour in one binding so the two cannot drift apart again, and set the name explicitly to white on the selected card and gray(235) on the unselected one. The subtitle already sets its own colour (GRAY on gray(30) is about 6.5:1) and is left alone. This fixes the contrast on the fixed-dark cards; it does not address the wider point that the rest of the window follows the system theme while these cards do not. --- crates/openplay-sender/src/app.rs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/crates/openplay-sender/src/app.rs b/crates/openplay-sender/src/app.rs index f918a53..17025d6 100644 --- a/crates/openplay-sender/src/app.rs +++ b/crates/openplay-sender/src/app.rs @@ -474,19 +474,29 @@ impl eframe::App for SenderApp { let selected = self.selected_key.as_deref() == Some(key); let (proto_label, proto_color) = protocol_badge(receiver.protocol()); + // The row cards are painted a fixed dark colour whatever the + // app theme is, so their text colour has to be fixed too. + // Inheriting the theme's default text colour put near-black + // text on a near-black card in light mode. + let (row_fill, name_colour) = if selected { + (Color32::from_rgb(40, 80, 140), Color32::WHITE) + } else { + (Color32::from_gray(30), Color32::from_gray(235)) + }; + let response = egui::Frame::none() - .fill(if selected { - Color32::from_rgb(40, 80, 140) - } else { - Color32::from_gray(30) - }) + .fill(row_fill) .rounding(6.0) .inner_margin(egui::Margin::symmetric(10.0, 6.0)) .show(ui, |ui| { ui.set_min_width(ui.available_width()); ui.horizontal(|ui| { ui.vertical(|ui| { - ui.label(RichText::new(receiver.display_name()).strong()); + ui.label( + RichText::new(receiver.display_name()) + .strong() + .color(name_colour), + ); ui.label( RichText::new(receiver_subtitle(receiver)) .small()