mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
Add size set function to GuiComponent
Similar to #92...
This commit is contained in:
parent
ac51656527
commit
45ed6ae4da
|
@ -102,6 +102,19 @@ Vector2u GuiComponent::getSize()
|
||||||
return mSize;
|
return mSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiComponent::setSize(Vector2u size)
|
||||||
|
{
|
||||||
|
mSize = size;
|
||||||
|
onSizeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GuiComponent::setSize(unsigned int w, unsigned int h)
|
||||||
|
{
|
||||||
|
mSize.x = w;
|
||||||
|
mSize.y = h;
|
||||||
|
onSizeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
//Children stuff.
|
//Children stuff.
|
||||||
void GuiComponent::addChild(GuiComponent* cmp)
|
void GuiComponent::addChild(GuiComponent* cmp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,6 +36,9 @@ public:
|
||||||
virtual void onOffsetChanged() {};
|
virtual void onOffsetChanged() {};
|
||||||
|
|
||||||
Vector2u getSize();
|
Vector2u getSize();
|
||||||
|
void setSize(Vector2u size);
|
||||||
|
void setSize(unsigned int w, unsigned int h);
|
||||||
|
virtual void onSizeChanged() {};
|
||||||
|
|
||||||
void setParent(GuiComponent* parent);
|
void setParent(GuiComponent* parent);
|
||||||
GuiComponent* getParent();
|
GuiComponent* getParent();
|
||||||
|
|
Loading…
Reference in a new issue