From 8131b817614415174248d93d174d719e683ac1d1 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 7 Nov 2020 12:45:57 +0100 Subject: [PATCH] Editing now starts by default for the text edit popups. --- es-core/src/components/TextEditComponent.h | 6 +++--- es-core/src/guis/GuiComplexTextEditPopup.cpp | 1 + es-core/src/guis/GuiTextEditPopup.cpp | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/es-core/src/components/TextEditComponent.h b/es-core/src/components/TextEditComponent.h index e764a6915..123894dcb 100644 --- a/es-core/src/components/TextEditComponent.h +++ b/es-core/src/components/TextEditComponent.h @@ -34,6 +34,9 @@ public: void setValue(const std::string& val) override; std::string getValue() const override; + void startEditing(); + void stopEditing(); + inline bool isEditing() const { return mEditing; }; inline const std::shared_ptr& getFont() const { return mFont; } @@ -42,9 +45,6 @@ public: virtual std::vector getHelpPrompts() override; private: - void startEditing(); - void stopEditing(); - void onTextChanged(); void onCursorChanged(); diff --git a/es-core/src/guis/GuiComplexTextEditPopup.cpp b/es-core/src/guis/GuiComplexTextEditPopup.cpp index 1cfb1a982..959df66e3 100644 --- a/es-core/src/guis/GuiComplexTextEditPopup.cpp +++ b/es-core/src/guis/GuiComplexTextEditPopup.cpp @@ -88,6 +88,7 @@ GuiComplexTextEditPopup::GuiComplexTextEditPopup( textHeight + mButtonGrid->getSize().y() + 220); setPosition((Renderer::getScreenWidth() - mSize.x()) / 2, (Renderer::getScreenHeight() - mSize.y()) / 2); + mText->startEditing(); } void GuiComplexTextEditPopup::onSizeChanged() diff --git a/es-core/src/guis/GuiTextEditPopup.cpp b/es-core/src/guis/GuiTextEditPopup.cpp index d20752fec..b80039113 100644 --- a/es-core/src/guis/GuiTextEditPopup.cpp +++ b/es-core/src/guis/GuiTextEditPopup.cpp @@ -66,6 +66,7 @@ GuiTextEditPopup::GuiTextEditPopup( textHeight + mButtonGrid->getSize().y() + 40); setPosition((Renderer::getScreenWidth() - mSize.x()) / 2, (Renderer::getScreenHeight() - mSize.y()) / 2); + mText->startEditing(); } void GuiTextEditPopup::onSizeChanged()