@@ -216,13 +216,13 @@ fn glyph_icon_max_size(ui: &egui::Ui, glyph: &char, font_size: f32) -> egui::Vec
216
216
glyph_galley. rect . size ( )
217
217
}
218
218
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 {
220
220
move |ui : & mut egui:: Ui | {
221
221
let helper = AnimationHelper :: new ( ui, ( "glyph" , glyph) , max_size) ;
222
222
let painter = ui. painter_at ( helper. get_animation_rect ( ) ) ;
223
223
224
224
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 ) ;
226
226
227
227
let top_left = {
228
228
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
280
280
ui. horizontal ( |ui| {
281
281
for glyph in row_glyphs {
282
282
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
+ {
284
292
selected_glyph = Some ( * glyph) ;
285
293
}
286
294
}
0 commit comments