1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

Window contents move along with the window!

This commit is contained in:
Andreas Kling 2018-10-12 02:41:27 +02:00
parent 64127e0637
commit 6f6f9bd84d
10 changed files with 48 additions and 7 deletions

View file

@ -1,6 +1,7 @@
#include "Window.h"
#include "WindowManager.h"
#include "Event.h"
#include "Widget.h"
Window::Window(Object* parent)
: Object(parent)
@ -18,6 +19,7 @@ void Window::setMainWidget(Widget* widget)
return;
m_mainWidget = widget;
widget->setWindow(this);
}
void Window::setTitle(String&& title)
@ -47,5 +49,12 @@ void Window::event(Event& event)
return Object::event(event);
}
if (event.isPaintEvent()) {
if (m_mainWidget) {
printf("forward to main widget\n");
return m_mainWidget->event(event);
}
}
return Object::event(event);
}