Add a display server and graphical user interface #38

Merged
apio merged 103 commits from display-server into main 2023-09-20 18:49:21 +00:00
Showing only changes of commit 5908b07ee2 - Show all commits

View File

@ -26,7 +26,8 @@ namespace ui
Result<EventResult> Container::handle_mouse_move(Point position)
{
return m_widget->handle_mouse_move(position);
if (m_widget->rect().contains(position)) return m_widget->handle_mouse_move(position);
return ui::EventResult::DidNotHandle;
}
Result<EventResult> Container::handle_mouse_leave()
@ -36,12 +37,14 @@ namespace ui
Result<EventResult> Container::handle_mouse_down(Point position, int buttons)
{
return m_widget->handle_mouse_down(position, buttons);
if (m_widget->rect().contains(position)) return m_widget->handle_mouse_down(position, buttons);
return ui::EventResult::DidNotHandle;
}
Result<EventResult> Container::handle_mouse_up(Point position, int buttons)
{
return m_widget->handle_mouse_up(position, buttons);
if (m_widget->rect().contains(position)) return m_widget->handle_mouse_up(position, buttons);
return ui::EventResult::DidNotHandle;
}
Result<void> Container::draw(Canvas& canvas)