Refactor in a good state

This commit is contained in:
IlyaShurupov 2024-10-09 14:31:23 +03:00 committed by Ilya Shurupov
parent 4b6e7da994
commit 164359f6aa
21 changed files with 606 additions and 105 deletions

View file

@ -22,18 +22,15 @@ namespace tp {
mDebugColor = col;
}
void addChild(Widget* child) {
mChildren.push_back(child);
child->mParent = this;
triggerWidgetUpdate();
child->triggerWidgetUpdate();
}
void addChild(Widget* child);
WidgetManagerInterface* getRoot();
void triggerWidgetUpdate();
void bringToFront();
void bringToBack();
public:
virtual void process(const EventHandler& events) {}
virtual void draw(Canvas& canvas) { canvas.rect(mArea.getCurrentRect(), RGBA(1.f), 10); }
@ -63,12 +60,11 @@ namespace tp {
Widget* mParent = nullptr;
std::vector<Widget*> mChildren;
List<Widget*> mDepthOrder;
// relative to the parent
SpringRect mArea;
ualni mZValue = 0;
bool mInFocus = false;
// debug