mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibGUI: Hook up GWindow event dispatch for paint and mouse events.
This commit is contained in:
@@ -29,10 +29,10 @@ void WSWindow::set_rect(const Rect& rect)
|
||||
{
|
||||
if (m_rect == rect)
|
||||
return;
|
||||
auto oldRect = m_rect;
|
||||
auto old_rect = m_rect;
|
||||
m_rect = rect;
|
||||
m_backing = GraphicsBitmap::create(m_process, m_rect.size());
|
||||
WSWindowManager::the().notify_rect_changed(*this, oldRect, m_rect);
|
||||
WSWindowManager::the().notify_rect_changed(*this, old_rect, m_rect);
|
||||
}
|
||||
|
||||
// FIXME: Just use the same types.
|
||||
@@ -60,16 +60,19 @@ void WSWindow::event(WSEvent& event)
|
||||
gui_event.type = GUI_Event::Type::MouseMove;
|
||||
gui_event.mouse.position = static_cast<MouseEvent&>(event).position();
|
||||
gui_event.mouse.button = GUI_MouseButton::NoButton;
|
||||
gui_event.mouse.buttons = static_cast<MouseEvent&>(event).buttons();
|
||||
break;
|
||||
case WSEvent::MouseDown:
|
||||
gui_event.type = GUI_Event::Type::MouseDown;
|
||||
gui_event.mouse.position = static_cast<MouseEvent&>(event).position();
|
||||
gui_event.mouse.button = to_api(static_cast<MouseEvent&>(event).button());
|
||||
gui_event.mouse.buttons = static_cast<MouseEvent&>(event).buttons();
|
||||
break;
|
||||
case WSEvent::MouseUp:
|
||||
gui_event.type = GUI_Event::Type::MouseUp;
|
||||
gui_event.mouse.position = static_cast<MouseEvent&>(event).position();
|
||||
gui_event.mouse.button = to_api(static_cast<MouseEvent&>(event).button());
|
||||
gui_event.mouse.buttons = static_cast<MouseEvent&>(event).buttons();
|
||||
break;
|
||||
case WSEvent::KeyDown:
|
||||
gui_event.type = GUI_Event::Type::KeyDown;
|
||||
|
||||
Reference in New Issue
Block a user