Modal dialog for partner file action, fix lifetime

This commit is contained in:
Kyle Reed 2023-05-02 09:38:08 -07:00
parent 2cba96ff36
commit 11f4edc892
10 changed files with 138 additions and 139 deletions

View file

@ -53,9 +53,7 @@ public:
const std::string& value() const;
void set(const std::string& str);
void set_cursor(uint32_t pos);
void set_max_length(size_t max_length);
void set_insert_mode();
void set_overwrite_mode();
@ -103,18 +101,22 @@ protected:
};
};
// Show the TextEntry view to receive keyboard input.
// NB: This function returns immediately. 'str' is taken
// by reference and its lifetime must be ensured by the
// caller until the TextEntry view is dismissed.
void text_prompt(
NavigationView& nav,
std::string& str,
size_t max_length,
const std::function<void(std::string&)> on_done = nullptr);
std::function<void(std::string&)> on_done = nullptr);
void text_prompt(
NavigationView& nav,
std::string& str,
uint32_t cursor_pos,
size_t max_length,
const std::function<void(std::string&)> on_done = nullptr);
std::function<void(std::string&)> on_done = nullptr);
} /* namespace ui */