From 2d8c9c729053ba0e5c527944be2d363b440fd5ac Mon Sep 17 00:00:00 2001 From: crumblingstatue Date: Tue, 5 Nov 2024 20:59:28 +0100 Subject: [PATCH] top_panel: Make selection a/b editable with drag values --- src/gui/top_panel.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/top_panel.rs b/src/gui/top_panel.rs index 0ffa9d8..d8c0c31 100644 --- a/src/gui/top_panel.rs +++ b/src/gui/top_panel.rs @@ -20,11 +20,13 @@ pub fn ui(ui: &mut Ui, gui: &mut Gui, app: &mut App, lua: &Lua, font_size: u16, if app.hex_ui.select_a.is_some() || app.hex_ui.select_b.is_some() { ui.label("Selection"); } - if let Some(a) = app.hex_ui.select_a { - ui.label(format!("a: {a}")); + if let Some(a) = &mut app.hex_ui.select_a { + ui.label("a"); + ui.add(egui::DragValue::new(a)); } - if let Some(b) = app.hex_ui.select_b { - ui.label(format!("b: {b}")); + if let Some(b) = &mut app.hex_ui.select_b { + ui.label("b"); + ui.add(egui::DragValue::new(b)); } if let Some(sel) = app.hex_ui.selection() && let Some(view_key) = app.hex_ui.focused_view