Add widget state support.
This commit is contained in:
parent
19091a0e80
commit
8536908eab
19 changed files with 385 additions and 46 deletions
|
@ -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>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue