diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 10:13:40 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 10:13:40 +0100 |
commit | eb2e62609992ab8b47f8805f2bc2cafce271b66f (patch) | |
tree | 58d6c387f910e3a3348a6528127f4216b524ec57 /src/gui/gui.cpp | |
parent | 05dc1666dc794ed6aa7f6568b768c652f8922c4e (diff) | |
parent | 8d06606835e3d01f537ebe96de8b216e64a1f969 (diff) | |
download | mana-eb2e62609992ab8b47f8805f2bc2cafce271b66f.tar.gz mana-eb2e62609992ab8b47f8805f2bc2cafce271b66f.tar.bz2 mana-eb2e62609992ab8b47f8805f2bc2cafce271b66f.tar.xz mana-eb2e62609992ab8b47f8805f2bc2cafce271b66f.zip |
Merge branch 'master' into lpc2012lpc2012
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 2e1d006e..cb6682bd 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -26,6 +26,7 @@ #include "gui/sdlinput.h" #include "gui/truetypefont.h" +#include "gui/widgets/textfield.h" #include "gui/widgets/window.h" #include "gui/widgets/windowcontainer.h" @@ -190,6 +191,12 @@ void Gui::logic() Palette::advanceGradients(); gcn::Gui::logic(); + + while (!guiInput->isTextQueueEmpty()) + { + TextInput textInput = guiInput->dequeueTextInput(); + handleTextInput(textInput); + } } void Gui::draw() @@ -267,3 +274,14 @@ void Gui::handleMouseMoved(const gcn::MouseInput &mouseInput) gcn::Gui::handleMouseMoved(mouseInput); mMouseInactivityTimer = 0; } + +void Gui::handleTextInput(const TextInput &textInput) +{ + if (auto focused = mFocusHandler->getFocused()) + { + if (auto textField = dynamic_cast<TextField*>(focused)) + { + textField->textInput(textInput); + } + } +} |