From d04ef00649a363aceeb53820b97d8a45ab55afaf Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 18 Dec 2024 21:25:25 +0100 Subject: [PATCH] bump egui to `0.30.0` --- .github/workflows/ci.yml | 6 +++--- Cargo.toml | 22 ++++++++++++---------- src/ui/examples/egui_file_dialog.rs | 6 +++--- src/ui/examples/egui_json_tree.rs | 4 ++-- src/ui/examples/egui_notify.rs | 5 ++--- src/ui/examples/egui_phosphor.rs | 10 +++++----- 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16986af..1c52dfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up cargo cache + uses: Swatinem/rust-cache@v2 + - name: Build run: cargo build - - name: Test - run: cargo test - - name: Check formatting run: cargo fmt --all -- --check diff --git a/Cargo.toml b/Cargo.toml index bec5a7c..6b52be3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,12 +4,12 @@ version = "0.1.0" edition = "2021" [dependencies] -anyhow = "1.0.89" -eframe = "0.29.1" -egui = "0.29.1" -egui-file-dialog = "0.7.0" -egui-notify = "0.16.0" -egui-phosphor = { version = "0.7.3", features = [ +anyhow = "1.0.94" +eframe = "0.30.0" +egui = "0.30.0" +egui-file-dialog = "0.8.0" +egui-notify = "0.18.0" +egui-phosphor = { version = "0.8.0", features = [ "bold", "fill", "light", @@ -17,15 +17,17 @@ egui-phosphor = { version = "0.7.3", features = [ ] } egui_file = "0.19.0" egui_form = { version = "0.3.0", features = ["validator_garde"] } -egui_json_tree = "0.7.1" -egui_plot = "0.29.0" -egui_tiles = "0.10.1" +egui_json_tree = "0.9.0" +egui_plot = "0.30.0" +egui_tiles = "0.11.0" garde = { version = "0.20.0", features = ["derive"] } -serde_json = "1.0.128" +serde_json = "1.0.133" strum = "0.26.3" strum_macros = "0.26.4" [patch.crates-io] +egui_form = { git = "https://github.com/elwerene/hello_egui", branch = "update-to-egui-0.30" } +egui_file = { git = "https://github.com/bircni/egui_file", branch = "patch-1" } [lints.rust] unsafe_code = "forbid" diff --git a/src/ui/examples/egui_file_dialog.rs b/src/ui/examples/egui_file_dialog.rs index db7d788..76255ce 100644 --- a/src/ui/examples/egui_file_dialog.rs +++ b/src/ui/examples/egui_file_dialog.rs @@ -26,7 +26,7 @@ impl EguiFileDialog { repository_link(ui, "https://github.com/fluxxcode/egui-file-dialog"); }); - if let Some(path) = self.file_dialog.take_selected() { + if let Some(path) = self.file_dialog.take_picked() { self.selected_path = Some(path); } ui.label(format!( @@ -36,11 +36,11 @@ impl EguiFileDialog { .map_or_else(|| "None".to_owned(), |p| p.to_string_lossy().to_string()) )); ui.button("Select file").clicked().then(|| { - self.file_dialog.select_file(); + self.file_dialog.pick_file(); }); ui.button("Select directory") .clicked() - .then(|| self.file_dialog.select_directory()); + .then(|| self.file_dialog.pick_directory()); self.file_dialog.update(ui.ctx()); } diff --git a/src/ui/examples/egui_json_tree.rs b/src/ui/examples/egui_json_tree.rs index d52144b..9faaec8 100644 --- a/src/ui/examples/egui_json_tree.rs +++ b/src/ui/examples/egui_json_tree.rs @@ -1,5 +1,5 @@ use egui::Ui; -use egui_json_tree::JsonTree; +use egui_json_tree::{JsonTree, JsonTreeStyle}; use super::repository_link; @@ -16,6 +16,6 @@ pub fn show_egui_json(ui: &mut Ui) { serde_json::json!({ "egui": "gui", "rust": ["1.78", "1.79", "1.80"], "cargo": true }); JsonTree::new("json_tree", &value) - .abbreviate_root(true) + .style(JsonTreeStyle::default().abbreviate_root(true)) .show(ui); } diff --git a/src/ui/examples/egui_notify.rs b/src/ui/examples/egui_notify.rs index fcdb9bc..0b0a6ab 100644 --- a/src/ui/examples/egui_notify.rs +++ b/src/ui/examples/egui_notify.rs @@ -1,5 +1,5 @@ use eframe::egui::Slider; -use egui::{Color32, FontId, Shadow, Theme, Ui, Vec2}; +use egui::{Color32, Shadow, Theme, Ui, Vec2}; use egui_notify::{Toast, Toasts}; use std::time::Duration; @@ -93,8 +93,7 @@ And another one" }; t.closable(self.closable) .duration(duration) - .show_progress_bar(self.show_progress_bar) - .font(FontId::proportional(self.font_size)); + .show_progress_bar(self.show_progress_bar); }; ui.horizontal(|ui| { diff --git a/src/ui/examples/egui_phosphor.rs b/src/ui/examples/egui_phosphor.rs index 5dff768..d0a8eb4 100644 --- a/src/ui/examples/egui_phosphor.rs +++ b/src/ui/examples/egui_phosphor.rs @@ -10,7 +10,7 @@ pub fn init_egui_phosphor(cc: &eframe::CreationContext) { egui_phosphor::add_to_fonts(&mut fonts, egui_phosphor::Variant::Regular); fonts.font_data.insert( "phosphor-thin".into(), - egui_phosphor::Variant::Thin.font_data(), + egui_phosphor::Variant::Thin.font_data().into(), ); fonts.families.insert( egui::FontFamily::Name("phosphor-thin".into()), @@ -19,7 +19,7 @@ pub fn init_egui_phosphor(cc: &eframe::CreationContext) { fonts.font_data.insert( "phosphor-light".into(), - egui_phosphor::Variant::Light.font_data(), + egui_phosphor::Variant::Light.font_data().into(), ); fonts.families.insert( egui::FontFamily::Name("phosphor-light".into()), @@ -28,7 +28,7 @@ pub fn init_egui_phosphor(cc: &eframe::CreationContext) { fonts.font_data.insert( "phosphor".into(), - egui_phosphor::Variant::Regular.font_data(), + egui_phosphor::Variant::Regular.font_data().into(), ); fonts.families.insert( egui::FontFamily::Name("phosphor".into()), @@ -37,7 +37,7 @@ pub fn init_egui_phosphor(cc: &eframe::CreationContext) { fonts.font_data.insert( "phosphor-bold".into(), - egui_phosphor::Variant::Bold.font_data(), + egui_phosphor::Variant::Bold.font_data().into(), ); fonts.families.insert( egui::FontFamily::Name("phosphor-bold".into()), @@ -46,7 +46,7 @@ pub fn init_egui_phosphor(cc: &eframe::CreationContext) { fonts.font_data.insert( "phosphor-fill".into(), - egui_phosphor::Variant::Fill.font_data(), + egui_phosphor::Variant::Fill.font_data().into(), ); fonts.families.insert( egui::FontFamily::Name("phosphor-fill".into()),