Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions crates/openplay-sender/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading