name.rs (533B)
1 use egui::RichText; 2 use notedeck::{NostrName, NotedeckTextStyle}; 3 4 pub fn one_line_display_name_widget<'a>( 5 visuals: &egui::Visuals, 6 display_name: NostrName<'a>, 7 style: NotedeckTextStyle, 8 ) -> impl egui::Widget + 'a { 9 let text_style = style.text_style(); 10 let color = visuals.noninteractive().fg_stroke.color; 11 12 move |ui: &mut egui::Ui| -> egui::Response { 13 ui.label( 14 RichText::new(display_name.name()) 15 .text_style(text_style) 16 .color(color), 17 ) 18 } 19 }