cleanup themeing
This commit is contained in:
@@ -239,11 +239,11 @@ impl MathApp {
|
|||||||
cc.egui_ctx.set_fonts(data.fonts);
|
cc.egui_ctx.set_fonts(data.fonts);
|
||||||
|
|
||||||
// Set dark mode by default
|
// Set dark mode by default
|
||||||
cc.egui_ctx.set_visuals(const { crate::style::dark() });
|
cc.egui_ctx.set_visuals(crate::style::STYLE);
|
||||||
|
|
||||||
// Set spacing
|
// Set spacing
|
||||||
let mut style: egui::Style = (*cc.egui_ctx.style()).clone();
|
let mut style: egui::Style = (*cc.egui_ctx.style()).clone();
|
||||||
style.spacing = const { crate::style::spacing() };
|
style.spacing = crate::style::SPACING;
|
||||||
cc.egui_ctx.set_style(style);
|
cc.egui_ctx.set_style(style);
|
||||||
|
|
||||||
tracing::info!("Initialized! Took: {:?}", start.elapsed());
|
tracing::info!("Initialized! Took: {:?}", start.elapsed());
|
||||||
|
|||||||
@@ -46,8 +46,9 @@ const fn widgets_dark() -> Widgets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub const STYLE: Visuals = dark();
|
pub const STYLE: Visuals = dark();
|
||||||
|
pub const SPACING: Spacing = spacing();
|
||||||
|
|
||||||
pub const fn dark() -> Visuals {
|
const fn dark() -> Visuals {
|
||||||
Visuals {
|
Visuals {
|
||||||
dark_mode: true,
|
dark_mode: true,
|
||||||
override_text_color: None,
|
override_text_color: None,
|
||||||
@@ -69,7 +70,7 @@ pub const fn dark() -> Visuals {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn spacing() -> Spacing {
|
const fn spacing() -> Spacing {
|
||||||
Spacing {
|
Spacing {
|
||||||
item_spacing: vec2(8.0, 3.0),
|
item_spacing: vec2(8.0, 3.0),
|
||||||
window_margin: Margin::same(6.0),
|
window_margin: Margin::same(6.0),
|
||||||
|
|||||||
Reference in New Issue
Block a user