From baf8fe7bc53bd6a8d7099c5881a2314582ef6d0f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 12 Apr 2021 05:25:51 +0200 Subject: [PATCH] Propter may accept current value --- libs/widgets/widgets/prompter.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/widgets/widgets/prompter.h b/libs/widgets/widgets/prompter.h index 94e0ad65cc..8ed7aa36f5 100644 --- a/libs/widgets/widgets/prompter.h +++ b/libs/widgets/widgets/prompter.h @@ -46,9 +46,12 @@ public: entryLabel.set_label (prompt); } - void set_initial_text (std::string txt) { + void set_initial_text (std::string txt, bool allow_replace = false) { entry.set_text (txt); entry.select_region (0, entry.get_text_length()); + if (allow_replace) { + on_entry_changed (); + } } void change_labels (std::string ok, std::string cancel);