Refactor in a good state
This commit is contained in:
parent
4b6e7da994
commit
164359f6aa
21 changed files with 606 additions and 105 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue