add switching text edit state

This commit is contained in:
Stepanov Igor 2025-10-11 09:31:41 +03:00
parent 968d01274a
commit 726f004893
4 changed files with 19 additions and 3 deletions

View file

@ -4,6 +4,7 @@
#include "Container.hpp"
#include "graphics/core/Batch2D.hpp"
#include "graphics/ui/GUI.hpp"
using gui::UINode;
using gui::Align;
@ -107,11 +108,13 @@ bool UINode::isPressed() const {
}
void UINode::onFocus() {
gui.getInput().startTextInput();
focused = true;
focusCallbacks.notify(gui);
}
void UINode::defocus() {
gui.getInput().stopTextInput();
focused = false;
defocusCallbacks.notify(gui);
}