diff --git a/Cargo.toml b/Cargo.toml index 63bc1db..993e3a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,30 +20,33 @@ strip = true lto = "thin" [dependencies] -winit = { version = "0.29.15", default-features = true } -eframe = { version = "0.27.2", default-features = false, features = [ +winit = { version = "0.29.4", default-features = true } +eframe = { version = "0.28.1", default-features = false, features = [ "accesskit", "persistence", "wgpu", "wayland", "x11", ] } -egui = { version = "0.27.2", default-features = false, features = [ +egui = { version = "0.28.1", default-features = false, features = [ "persistence", ] } -egui_extras = "0.27.2" +egui_extras = "0.28.1" hex = "0.4.3" -plist = "1.6.1" +plist = "1.7.0" rfd = "0.14.1" -serde = { version = "1.0.201", features = ["derive"] } +serde = { version = "1.0.203", features = ["derive"] } egui-modal = "0.3.6" [target.'cfg(target_os = "macos")'.dependencies] -objc2 = "0.5.1" -objc2-app-kit = { version = "0.2.0", features = [ +objc2 = "0.5.2" +objc2-app-kit = { version = "0.2.2", features = [ "NSResponder", "NSApplication", "NSMenu", "NSMenuItem", ] } -objc2-foundation = { version = "0.2.0", features = ["NSString", "NSThread"] } +objc2-foundation = { version = "0.2.2", features = ["NSString", "NSThread"] } + +[patch.crates-io] +egui-modal = { git = "https://github.com/crumblingstatue/egui-modal/", branch = "egui-0.28" } diff --git a/src/main.rs b/src/main.rs index 198f22e..51402f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,10 +34,10 @@ fn main() { ..Default::default() }, Box::new(|cc| { - Box::new(PlistOxide::new( + Ok(Box::new(PlistOxide::new( cc, std::env::args().nth(1).map(PathBuf::from), - )) + ))) }), ) .unwrap(); diff --git a/src/widgets/click_text_edit.rs b/src/widgets/click_text_edit.rs index 9e2637c..d95d095 100644 --- a/src/widgets/click_text_edit.rs +++ b/src/widgets/click_text_edit.rs @@ -2,8 +2,8 @@ //! See LICENSE for details. use egui::{ - Color32, Context, CursorIcon, Id, Key, Response, RichText, TextEdit, TextStyle, Ui, Widget, - WidgetInfo, + Color32, Context, CursorIcon, Id, Key, PopupCloseBehavior, Response, RichText, TextEdit, + TextStyle, Ui, Widget, WidgetInfo, }; type GetSetValue<'a> = Box) -> String>; @@ -84,14 +84,20 @@ impl<'a> Widget for ClickableTextEdit<'a> { .id(kb_edit_id) .font(TextStyle::Monospace), ); - egui::popup::popup_below_widget(ui, popup_id, &response, |ui| { - ui.set_min_width(100.0); - ui.label( - RichText::new("Value is currently invalid") - .color(Color32::RED) - .strong(), - ); - }); + egui::popup::popup_below_widget( + ui, + popup_id, + &response, + PopupCloseBehavior::IgnoreClicks, + |ui| { + ui.set_min_width(100.0); + ui.label( + RichText::new("Value is currently invalid") + .color(Color32::RED) + .strong(), + ); + }, + ); if validate_value(state.edit_string.as_str()) { ui.memory_mut(egui::Memory::close_popup); @@ -127,7 +133,9 @@ impl<'a> Widget for ClickableTextEdit<'a> { let value = get(&mut get_set_value); response.changed = value != old_value; - response.widget_info(|| WidgetInfo::text_edit(old_value.as_str(), value.as_str())); + response.widget_info(|| { + WidgetInfo::text_edit(ui.is_enabled(), old_value.as_str(), value.as_str()) + }); response } } diff --git a/src/widgets/toggle.rs b/src/widgets/toggle.rs index 8a2a0a6..9159e6a 100644 --- a/src/widgets/toggle.rs +++ b/src/widgets/toggle.rs @@ -24,10 +24,12 @@ impl<'a> Widget for Toggle<'a> { *on = !*on; response.mark_changed(); } - response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Checkbox, *on, "")); + response.widget_info(|| { + egui::WidgetInfo::selected(egui::WidgetType::Checkbox, ui.is_enabled(), *on, "") + }); if ui.is_rect_visible(rect) { - let how_on = ui.ctx().animate_bool(response.id, *on); + let how_on = ui.ctx().animate_bool_responsive(response.id, *on); let visuals = ui.style().interact_selectable(&response, *on); let rect = rect.expand(visuals.expansion); let radius = 0.5 * rect.height();