From 97aaa651d83671bce93a3cb87c3d44d0e387d54e Mon Sep 17 00:00:00 2001 From: William Casarin Date: Fri, 16 Feb 2024 11:37:41 -0800 Subject: [PATCH] style: allow font style customization in the future I had a work in progress commit that changed font styles that needed this change, so doing it here for now. Signed-off-by: William Casarin --- src/app.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app.rs b/src/app.rs index fd6d0f5..0237689 100644 --- a/src/app.rs +++ b/src/app.rs @@ -408,9 +408,7 @@ fn process_message(damus: &mut Damus, relay: &str, msg: &RelayMessage) { } fn render_damus(damus: &mut Damus, ctx: &Context) { - ctx.style_mut(|style| { - set_app_style(&mut style.visuals); - }); + ctx.style_mut(set_app_style); if is_mobile(ctx) { render_damus_mobile(ctx, damus); @@ -858,7 +856,8 @@ fn render_panel<'a>(ctx: &egui::Context, app: &'a mut Damus, timeline_ind: usize }); } -fn set_app_style(visuals: &mut Visuals) { +fn set_app_style(style: &mut Style) { + let visuals = &mut style.visuals; visuals.hyperlink_color = PURPLE; if visuals.dark_mode { visuals.override_text_color = Some(egui::Color32::from_rgb(250, 250, 250));