Back with clickable button.

This commit is contained in:
James Grogan 2022-11-16 17:00:55 +00:00
parent 3e53bd9e00
commit 70891ce7b4
20 changed files with 107 additions and 50 deletions

View file

@ -26,7 +26,7 @@ Widget::Widget()
mBorderColor(Color(0, 0, 0)),
mVisible(true)
{
mName = "Widget";
}
Widget::~Widget()
@ -111,7 +111,7 @@ void Widget::setBackgroundColor(const Color& color)
{
if (mBackgroundColor != color)
{
mBackgroundColor = std::move(color);
mBackgroundColor = color;
mMaterialDirty = true;
}
}
@ -169,6 +169,8 @@ void Widget::onPaintEvent(const PaintEvent* event)
if (isDirty())
{
mRootNode->setName(mName);
doPaint(event);
mTransformDirty = false;
@ -284,6 +286,8 @@ void Widget::updateBackground(const PaintEvent* event)
if (!mBackgroundNode)
{
mBackgroundNode = std::make_unique<RectangleNode>(DiscretePoint(locX, locY), deltaX, deltaY);
mBackgroundNode->setName(mName + "_BackgroundNode");
mRootNode->addChild(mBackgroundNode.get());
}