Skip to content

Commit

Permalink
update egui
Browse files Browse the repository at this point in the history
  • Loading branch information
bircni committed Sep 27, 2024
1 parent 0a94460 commit 2539b2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -18,7 +18,6 @@ fn main() -> anyhow::Result<()> {
"Awtrix",
eframe::NativeOptions {
viewport,
follow_system_theme: true,
centered: true,
..Default::default()
},
Expand Down
9 changes: 7 additions & 2 deletions src/ui/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
};
Expand Down

0 comments on commit 2539b2b

Please sign in to comment.