Window contents move along with the window!

This commit is contained in:
Andreas Kling 2018-10-12 02:41:27 +02:00
commit 6f6f9bd84d
Notes: sideshowbarker 2024-07-19 18:50:21 +09:00
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);
}