From 54c1f1ba73b5ed73e4033f891345361f7cde2845 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Mon, 17 Dec 2018 20:21:55 -0800 Subject: [PATCH] update modal menu prompt --- ezgui/src/input.rs | 1 + ezgui/src/menu.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ezgui/src/input.rs b/ezgui/src/input.rs index 523e10aba3..534770bc06 100644 --- a/ezgui/src/input.rs +++ b/ezgui/src/input.rs @@ -296,6 +296,7 @@ impl UserInput { panic!("set_mode called on both {} and {}", existing_mode, mode); } menu.mark_all_inactive(); + menu.change_prompt(prompt); } else { if let Some(ref m) = self.modal_state.modes.get(mode) { let mut menu = Menu::new( diff --git a/ezgui/src/menu.rs b/ezgui/src/menu.rs index c3c57f3303..be125c03b1 100644 --- a/ezgui/src/menu.rs +++ b/ezgui/src/menu.rs @@ -210,4 +210,10 @@ impl Menu { *active = false; } } + + // Assume that this doesn't vastly affect width. + pub fn change_prompt(&mut self, prompt: String) { + assert!(self.prompt.is_some()); + self.prompt = Some(prompt); + } }