Remove expensive path.string() calls, UI changes

This commit is contained in:
Kyle Reed 2023-04-30 22:42:28 -07:00
parent 06643df6a5
commit bf4ed416bd
8 changed files with 254 additions and 147 deletions

View file

@ -82,6 +82,8 @@ public:
void focus() override;
std::string title() const override { return "Text entry"; };
void set_cursor(uint32_t pos);
protected:
TextEntryView(NavigationView& nav, std::string& str, size_t max_length);
@ -101,7 +103,18 @@ protected:
};
};
void text_prompt(NavigationView& nav, std::string& str, size_t max_length, const std::function<void(std::string&)> on_done = nullptr);
void text_prompt(
NavigationView& nav,
std::string& str,
size_t max_length,
const 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);
} /* namespace ui */