Add focusable Renderer. (#173)

This commit is contained in:
Arthur Sonzogni
2021-08-06 20:32:33 +02:00
committed by GitHub
parent 26e26fd41a
commit 3f005d7715
19 changed files with 151 additions and 68 deletions

View File

@@ -56,10 +56,9 @@ class InputBase : public ComponentBase {
std::wstring part_at_cursor = cursor_position() < (int)content.size()
? content.substr(cursor_position(), 1)
: L" ";
std::wstring part_after_cursor =
cursor_position() < (int)content.size() - 1
? content.substr(cursor_position() + 1)
: L"";
std::wstring part_after_cursor = cursor_position() < (int)content.size() - 1
? content.substr(cursor_position() + 1)
: L"";
auto focused = is_focused ? focus : select;
// clang-format off
@@ -164,9 +163,7 @@ class InputBase : public ComponentBase {
return true;
}
bool Focusable() const final {
return true;
}
bool Focusable() const final { return true; }
StringRef content_;
ConstStringRef placeholder_;