diff --git a/src/editor.rs b/src/editor.rs index 0cd67c6..33c640b 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -276,6 +276,18 @@ impl Editor { } d.draw_text("save", 95, 10, 20, Color::WHITE); } + + let mut input_text = String::from_utf8_lossy(self.machine.input()).to_string(); + let width = d.get_screen_width(); + d.draw_text("input:", width - 260, 10, 20, Color::WHITE); + if text_input( + d, + Rectangle::new(width as f32 - 205., 5., 200., 30.), + &mut input_text, + &mut self.input_text_selected, + ) { + self.machine.set_input(input_text.into_bytes()); + } } fn draw_bottom_bar(&mut self, d: &mut RaylibDrawHandle, textures: &Textures) { @@ -290,16 +302,6 @@ impl Editor { Color::new(32, 32, 32, 255), ); - let mut input_text = String::from_utf8_lossy(self.machine.input()).to_string(); - if text_input( - d, - Rectangle::new(5., footer_top + 60., 200., 25.), - &mut input_text, - &mut self.input_text_selected, - ) { - self.machine.set_input(input_text.into_bytes()); - } - let mut tool_button = |(row, col): (i32, i32), texture: &str, tool_option: Tool| { let border = 4.; let gap = 2.;