Update Input's options. (#195)

- Password is now taking a ref, allowing a shared state to be used by
  multiple passwords.

- Password cursor position is now optional. It will be used only when
  set to something different from -1.
This commit is contained in:
Arthur Sonzogni
2021-08-22 13:51:00 +02:00
committed by GitHub
parent 69b0c9e53e
commit b95a7a4c6b
3 changed files with 21 additions and 5 deletions

View File

@@ -51,9 +51,11 @@ struct InputOption {
std::function<void()> on_enter = [] {};
/// Obscure the input content using '*'.
bool password = false;
Ref<bool> password = false;
Ref<int> cursor_position = 0;
/// When set different from -1, this attributes is used to store the cursor
/// position.
Ref<int> cursor_position = -1;
};
/// @brief Option for the Radiobox component.