From 2539b2bf8e354dcea1363cba53454ededeba1436 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 27 Sep 2024 12:14:22 +0200 Subject: [PATCH] update egui --- Cargo.toml | 9 ++++++--- src/main.rs | 3 +-- src/ui/settings.rs | 9 +++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1362efd..165f754 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,14 +39,17 @@ serde = { version = "1.0.210", features = ["derive"] } serde_json = "1.0.128" semver = "1.0.23" # GUI -eframe = "0.28.1" -egui = "0.28.1" +eframe = "0.29.0" +egui = "0.29.0" egui-notify = "0.15.0" -egui_extras = { version = "0.28.1", features = ["syntect", "image"] } +egui_extras = { version = "0.29.0", features = ["syntect", "image"] } image = "0.25.2" open = "5.3.0" parking_lot = "0.12.3" +[patch.crates-io] +egui-notify = { git = "https://github.com/ItsEthra/egui-notify", branch = "master" } + [lints.rust] unsafe_code = "forbid" diff --git a/src/main.rs b/src/main.rs index 08b64fa..1e9d39a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ fn main() -> anyhow::Result<()> { let viewport = ViewportBuilder::default() .with_title("Awtrix") .with_app_id("awtrix-gui") - .with_inner_size(egui::vec2(600.0, 400.0)) + .with_inner_size(egui::vec2(900.0, 600.0)) .with_icon( eframe::icon_data::from_png_bytes(include_bytes!("../res/icon.png")) .unwrap_or_default(), @@ -18,7 +18,6 @@ fn main() -> anyhow::Result<()> { "Awtrix", eframe::NativeOptions { viewport, - follow_system_theme: true, centered: true, ..Default::default() }, diff --git a/src/ui/settings.rs b/src/ui/settings.rs index 5457958..8f80bdf 100644 --- a/src/ui/settings.rs +++ b/src/ui/settings.rs @@ -52,8 +52,13 @@ impl Settings { }); let theme = syntax_highlighting::CodeTheme::from_style(ui.style()); let mut layouter = |ui: &Ui, string: &str, wrap_width: f32| { - let mut layout_job = - syntax_highlighting::highlight(ui.ctx(), &theme, string, &self.language); + let mut layout_job = syntax_highlighting::highlight( + ui.ctx(), + ui.style(), + &theme, + string, + &self.language, + ); layout_job.wrap.max_width = wrap_width; ui.fonts(|f| f.layout_job(layout_job)) };