Skip to content

Commit c08b5a6

Browse files
committed
ui: use text color for glyphs
Signed-off-by: kernelkind <[email protected]>
1 parent e2b8f4e commit c08b5a6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/ui/configure_deck.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ fn glyph_icon_max_size(ui: &egui::Ui, glyph: &char, font_size: f32) -> egui::Vec
216216
glyph_galley.rect.size()
217217
}
218218

219-
fn glyph_icon(glyph: char, font_size: f32, max_size: egui::Vec2) -> impl Widget {
219+
fn glyph_icon(glyph: char, font_size: f32, max_size: egui::Vec2, color: Color32) -> impl Widget {
220220
move |ui: &mut egui::Ui| {
221221
let helper = AnimationHelper::new(ui, ("glyph", glyph), max_size);
222222
let painter = ui.painter_at(helper.get_animation_rect());
223223

224224
let font = deck_icon_font_sized(helper.scale_1d_pos(font_size));
225-
let glyph_galley = painter.layout_no_wrap(glyph.to_string(), font, Color32::WHITE);
225+
let glyph_galley = painter.layout_no_wrap(glyph.to_string(), font, color);
226226

227227
let top_left = {
228228
let mut glyph_rect = glyph_galley.rect;
@@ -280,7 +280,15 @@ fn paint_row(ui: &mut egui::Ui, row_glyphs: &[char], font_size: f32) -> Option<c
280280
ui.horizontal(|ui| {
281281
for glyph in row_glyphs {
282282
let glyph_size = glyph_icon_max_size(ui, glyph, font_size);
283-
if ui.add(glyph_icon(*glyph, font_size, glyph_size)).clicked() {
283+
if ui
284+
.add(glyph_icon(
285+
*glyph,
286+
font_size,
287+
glyph_size,
288+
ui.visuals().text_color(),
289+
))
290+
.clicked()
291+
{
284292
selected_glyph = Some(*glyph);
285293
}
286294
}

0 commit comments

Comments
 (0)