Refactor fixes

This commit is contained in:
IlyaShurupov 2024-10-09 19:36:17 +03:00 committed by Ilya Shurupov
parent 164359f6aa
commit 9f9dcd5882
5 changed files with 12 additions and 4 deletions

View file

@ -11,6 +11,10 @@ using namespace tp;
class WidgetApplication : public Application { class WidgetApplication : public Application {
public: public:
WidgetApplication() { WidgetApplication() {
setup1();
}
void setup1() {
mRootWidget.setRootWidget(&mDockLayout); mRootWidget.setRootWidget(&mDockLayout);
mDockLayout.addChild(&mFloatingMenu); mDockLayout.addChild(&mFloatingMenu);
@ -43,6 +47,10 @@ public:
// mLayoutWidget.addChild(&mLabel); // mLayoutWidget.addChild(&mLabel);
} }
void setup2() {
mRootWidget.setRootWidget(&mLabel);
}
void processFrame(EventHandler* eventHandler, halnf deltaTime) override { void processFrame(EventHandler* eventHandler, halnf deltaTime) override {
const auto rec = RectF({ 0, 0 }, mWindow->getSize()); const auto rec = RectF({ 0, 0 }, mWindow->getSize());
mRootWidget.processFrame(eventHandler, rec); mRootWidget.processFrame(eventHandler, rec);

View file

@ -50,7 +50,7 @@ void Widget::updateAnimations() {
} }
bool Widget::needsNextFrame() const { bool Widget::needsNextFrame() const {
return !mArea.shouldEndTransition() || mInFocus; return !mArea.shouldEndTransition();
} }
void Widget::adjustRect() { void Widget::adjustRect() {

View file

@ -54,6 +54,6 @@ namespace tp {
halnf mRounding = 5; halnf mRounding = 5;
RGBA mColorHovered = { 0.0f, 0.4f, 0.4f, 1.f }; RGBA mColorHovered = { 0.0f, 0.4f, 0.4f, 1.f };
RGBA mColor = { 0.0f, 0.0f, 0.0f, 1.f }; RGBA mColor = { 0.13f, 0.13f, 0.13f, 1.f };
}; };
} }