Added support for changing the BusyComponent text dynamically

This commit is contained in:
Leon Styhre 2023-03-21 18:35:43 +01:00
parent 32db3d78b1
commit 0939e5f05b
2 changed files with 2 additions and 1 deletions

View file

@ -10,7 +10,6 @@
#include "components/AnimatedImageComponent.h" #include "components/AnimatedImageComponent.h"
#include "components/ImageComponent.h" #include "components/ImageComponent.h"
#include "components/TextComponent.h"
// Animation definition. // Animation definition.
AnimationFrame BUSY_ANIMATION_FRAMES[] { AnimationFrame BUSY_ANIMATION_FRAMES[] {

View file

@ -12,6 +12,7 @@
#include "GuiComponent.h" #include "GuiComponent.h"
#include "components/ComponentGrid.h" #include "components/ComponentGrid.h"
#include "components/NinePatchComponent.h" #include "components/NinePatchComponent.h"
#include "components/TextComponent.h"
class AnimatedImageComponent; class AnimatedImageComponent;
class TextComponent; class TextComponent;
@ -21,6 +22,7 @@ class BusyComponent : public GuiComponent
public: public:
BusyComponent(); BusyComponent();
void setText(const std::string& text) { mText->setText(text, true); }
void onSizeChanged() override; void onSizeChanged() override;
void reset(); // Reset to frame 0. void reset(); // Reset to frame 0.