diff --git a/Cargo.toml b/Cargo.toml index 4a795bc..9c5b280 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 } @@ -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 diff --git a/egui_commonmark/examples/book.rs b/egui_commonmark/examples/book.rs index 15636aa..c1ca7ae 100644 --- a/egui_commonmark/examples/book.rs +++ b/egui_commonmark/examples/book.rs @@ -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| { diff --git a/egui_commonmark/examples/hello_world.rs b/egui_commonmark/examples/hello_world.rs index 5fefeec..f1fb30a 100644 --- a/egui_commonmark/examples/hello_world.rs +++ b/egui_commonmark/examples/hello_world.rs @@ -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); } } diff --git a/egui_commonmark/examples/interactive.rs b/egui_commonmark/examples/interactive.rs index 0b64dab..109c05c 100644 --- a/egui_commonmark/examples/interactive.rs +++ b/egui_commonmark/examples/interactive.rs @@ -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); } } diff --git a/egui_commonmark/examples/link_hooks.rs b/egui_commonmark/examples/link_hooks.rs index ac6cff9..fcd685f 100644 --- a/egui_commonmark/examples/link_hooks.rs +++ b/egui_commonmark/examples/link_hooks.rs @@ -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); } } diff --git a/egui_commonmark/examples/macros.rs b/egui_commonmark/examples/macros.rs index 59865d5..14b7405 100644 --- a/egui_commonmark/examples/macros.rs +++ b/egui_commonmark/examples/macros.rs @@ -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); } } diff --git a/egui_commonmark/examples/scroll.rs b/egui_commonmark/examples/scroll.rs index e75cb68..dd0c7bb 100644 --- a/egui_commonmark/examples/scroll.rs +++ b/egui_commonmark/examples/scroll.rs @@ -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); } } diff --git a/egui_commonmark/examples/show_mut.rs b/egui_commonmark/examples/show_mut.rs index 0ccc269..536c6e6 100644 --- a/egui_commonmark/examples/show_mut.rs +++ b/egui_commonmark/examples/show_mut.rs @@ -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); } } diff --git a/egui_commonmark/src/parsers/pulldown.rs b/egui_commonmark/src/parsers/pulldown.rs index d217515..a098c7c 100644 --- a/egui_commonmark/src/parsers/pulldown.rs +++ b/egui_commonmark/src/parsers/pulldown.rs @@ -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)); @@ -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. diff --git a/egui_commonmark_backend/src/misc.rs b/egui_commonmark_backend/src/misc.rs index 91519a5..8cfbc01 100644 --- a/egui_commonmark_backend/src/misc.rs +++ b/egui_commonmark_backend/src/misc.rs @@ -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,