Add widget state support.

This commit is contained in:
jmsgrogan 2023-01-18 13:29:31 +00:00
parent 19091a0e80
commit 8536908eab
19 changed files with 385 additions and 46 deletions

View file

@ -24,6 +24,8 @@ public:
void setLabel(const std::string& text);
void setEnabled(bool isEnabled);
void setOnClickFunction(clickFunc func);
protected:
@ -34,6 +36,10 @@ protected:
void updateLabel(const PaintEvent* event);
void setState(ButtonData::State state);
void resetState();
void updateState() override;
private:
ButtonData mStyle;
@ -42,6 +48,8 @@ private:
std::unique_ptr<TextNode> mTextNode;
bool mContentDirty{true};
bool mEnabled{ true };
};
using ButtonUPtr = std::unique_ptr<Button>;