Added a 'CLEAR' button to GuiTextEditPopup.

This commit is contained in:
Leon Styhre 2020-07-30 16:39:16 +02:00
parent bd7e0e5820
commit 3887bfff3d

View file

@ -45,6 +45,8 @@ GuiTextEditPopup::GuiTextEditPopup(
std::vector< std::shared_ptr<ButtonComponent> > buttons; std::vector< std::shared_ptr<ButtonComponent> > buttons;
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, acceptBtnText, acceptBtnText, buttons.push_back(std::make_shared<ButtonComponent>(mWindow, acceptBtnText, acceptBtnText,
[this, okCallback] { okCallback(mText->getValue()); delete this; })); [this, okCallback] { okCallback(mText->getValue()); delete this; }));
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "CLEAR", "clear",
[this] { mText->setValue(""); }));
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "CANCEL", "discard changes", buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "CANCEL", "discard changes",
[this] { delete this; })); [this] { delete this; }));