Skip to content

Commit

Permalink
Update to egui 0.29 (#65)
Browse files Browse the repository at this point in the history
* Update to latest egui

* Update examples

* Update egui

* Update to egui 0.29
  • Loading branch information
emilk authored Sep 26, 2024
1 parent 8848291 commit d03dbae
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 21 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ version = "0.17.0"
repository = "https://github.com/lampsitter/egui_commonmark"

[workspace.dependencies]
egui_extras = { version = "0.28", default-features = false }
egui = { version = "0.28", default-features = false }
egui_extras = { version = "0.29", default-features = false }
egui = { version = "0.29", default-features = false }

egui_commonmark_backend = { version = "0.17.0", path = "egui_commonmark_backend", default-features = false }
egui_commonmark_macros = { version = "0.17.0", path = "egui_commonmark_macros", default-features = false }
Expand All @@ -29,6 +29,6 @@ pulldown-cmark = { version = "0.12", default-features = false }


[patch.crates-io]
# eframe = { git = "https://github.com/emilk/egui.git", rev = "cbb5d6aa936c7498214dba03b594fbe75dbe7488" } # egui master 2024-06-05
# egui = { git = "https://github.com/emilk/egui.git", rev = "cbb5d6aa936c7498214dba03b594fbe75dbe7488" } # egui master 2024-06-05
# egui_extras = { git = "https://github.com/emilk/egui.git", rev = "cbb5d6aa936c7498214dba03b594fbe75dbe7488" } # egui master 2024-06-05
# eframe = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-13
# egui = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-13
# egui_extras = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-13
4 changes: 2 additions & 2 deletions egui_commonmark/examples/book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ fn main() -> eframe::Result {
Box::new(move |cc| {
if let Some(theme) = args.next() {
if theme == "light" {
cc.egui_ctx.set_visuals(egui::Visuals::light());
cc.egui_ctx.set_theme(egui::Theme::Light);
} else if theme == "dark" {
cc.egui_ctx.set_visuals(egui::Visuals::dark());
cc.egui_ctx.set_theme(egui::Theme::Dark);
}
}
cc.egui_ctx.style_mut(|style| {
Expand Down
4 changes: 2 additions & 2 deletions egui_commonmark/examples/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ fn main() -> eframe::Result {
Box::new(move |cc| {
if let Some(theme) = args.next() {
if theme == "light" {
cc.egui_ctx.set_visuals(egui::Visuals::light());
cc.egui_ctx.set_theme(egui::Theme::Light);
} else if theme == "dark" {
cc.egui_ctx.set_visuals(egui::Visuals::dark());
cc.egui_ctx.set_theme(egui::Theme::Dark);
}
}

Expand Down
4 changes: 2 additions & 2 deletions egui_commonmark/examples/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ fn main() -> eframe::Result {
Box::new(move |cc| {
if let Some(theme) = args.next() {
if theme == "light" {
cc.egui_ctx.set_visuals(egui::Visuals::light());
cc.egui_ctx.set_theme(egui::Theme::Light);
} else if theme == "dark" {
cc.egui_ctx.set_visuals(egui::Visuals::dark());
cc.egui_ctx.set_theme(egui::Theme::Dark);
}
}

Expand Down
4 changes: 2 additions & 2 deletions egui_commonmark/examples/link_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ fn main() -> eframe::Result {
Box::new(move |cc| {
if let Some(theme) = args.next() {
if theme == "light" {
cc.egui_ctx.set_visuals(egui::Visuals::light());
cc.egui_ctx.set_theme(egui::Theme::Light);
} else if theme == "dark" {
cc.egui_ctx.set_visuals(egui::Visuals::dark());
cc.egui_ctx.set_theme(egui::Theme::Dark);
}
}

Expand Down
4 changes: 2 additions & 2 deletions egui_commonmark/examples/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ fn main() -> eframe::Result {
Box::new(move |cc| {
if let Some(theme) = args.next() {
if theme == "light" {
cc.egui_ctx.set_visuals(egui::Visuals::light());
cc.egui_ctx.set_theme(egui::Theme::Light);
} else if theme == "dark" {
cc.egui_ctx.set_visuals(egui::Visuals::dark());
cc.egui_ctx.set_theme(egui::Theme::Dark);
}
}

Expand Down
4 changes: 2 additions & 2 deletions egui_commonmark/examples/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ fn main() -> eframe::Result {
Box::new(move |cc| {
if let Some(theme) = args.next() {
if theme == "light" {
cc.egui_ctx.set_visuals(egui::Visuals::light());
cc.egui_ctx.set_theme(egui::Theme::Light);
} else if theme == "dark" {
cc.egui_ctx.set_visuals(egui::Visuals::dark());
cc.egui_ctx.set_theme(egui::Theme::Dark);
}
}

Expand Down
4 changes: 2 additions & 2 deletions egui_commonmark/examples/show_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ fn main() -> eframe::Result {
Box::new(move |cc| {
if let Some(theme) = args.next() {
if theme == "light" {
cc.egui_ctx.set_visuals(egui::Visuals::light());
cc.egui_ctx.set_theme(egui::Theme::Light);
} else if theme == "dark" {
cc.egui_ctx.set_visuals(egui::Visuals::dark());
cc.egui_ctx.set_theme(egui::Theme::Dark);
}
}

Expand Down
4 changes: 2 additions & 2 deletions egui_commonmark/src/parsers/pulldown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl CommonMarkViewerInternal {

let Some(page_size) = scroll_cache(cache, &source_id).page_size else {
egui::ScrollArea::vertical()
.id_source(scroll_id)
.id_salt(scroll_id)
.auto_shrink([false, true])
.show(ui, |ui| {
self.show(ui, cache, options, text, Some(source_id));
Expand All @@ -200,7 +200,7 @@ impl CommonMarkViewerInternal {
let num_rows = events.len();

egui::ScrollArea::vertical()
.id_source(scroll_id)
.id_salt(scroll_id)
// Elements have different widths, so the scroll area cannot try to shrink to the
// content, as that will mean that the scroll bar will move when loading elements
// with different widths.
Expand Down
1 change: 1 addition & 0 deletions egui_commonmark_backend/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ impl CodeBlock {
fn simple_highlighting(ui: &Ui, text: &str, extension: &str) -> egui::text::LayoutJob {
egui_extras::syntax_highlighting::highlight(
ui.ctx(),
ui.style(),
&egui_extras::syntax_highlighting::CodeTheme::from_style(ui.style()),
text,
extension,
Expand Down

0 comments on commit d03dbae

Please sign in to comment.