mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:15:07 +00:00
LibGUI: Hook up GWindow event dispatch for paint and mouse events.
This commit is contained in:
parent
dbe83f3a83
commit
ea6678b7b3
9 changed files with 72 additions and 30 deletions
|
@ -36,10 +36,6 @@ void GWidget::event(GEvent& event)
|
|||
switch (event.type()) {
|
||||
case GEvent::Paint:
|
||||
m_hasPendingPaintEvent = false;
|
||||
if (auto* win = window()) {
|
||||
if (!win->is_visible())
|
||||
return;
|
||||
}
|
||||
return paintEvent(static_cast<GPaintEvent&>(event));
|
||||
case GEvent::Show:
|
||||
return showEvent(static_cast<GShowEvent&>(event));
|
||||
|
@ -63,7 +59,6 @@ void GWidget::event(GEvent& event)
|
|||
|
||||
void GWidget::paintEvent(GPaintEvent& event)
|
||||
{
|
||||
//printf("GWidget::paintEvent :)\n");
|
||||
if (fillWithBackgroundColor()) {
|
||||
Painter painter(*this);
|
||||
painter.fill_rect(rect(), backgroundColor());
|
||||
|
@ -125,7 +120,7 @@ GWidget::HitTestResult GWidget::hitTest(int x, int y)
|
|||
return { this, x, y };
|
||||
}
|
||||
|
||||
void GWidget::setWindow(GWindow* window)
|
||||
void GWidget::set_window(GWindow* window)
|
||||
{
|
||||
if (m_window == window)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue