diff --git a/apps/gclient.cpp b/apps/gclient.cpp index ba08db5d..1439cdca 100644 --- a/apps/gclient.cpp +++ b/apps/gclient.cpp @@ -20,16 +20,6 @@ struct ColorWidget : public ui::Widget return ui::EventResult::DidHandle; } - Result handle_mouse_down(ui::Point, int) override - { - return ui::EventResult::DidNotHandle; - } - - Result handle_mouse_up(ui::Point, int) override - { - return ui::EventResult::DidNotHandle; - } - Result draw(ui::Canvas& canvas) override { canvas.fill(m_color); diff --git a/libui/include/ui/Image.h b/libui/include/ui/Image.h index 481154f6..cbcc5485 100644 --- a/libui/include/ui/Image.h +++ b/libui/include/ui/Image.h @@ -84,10 +84,6 @@ namespace ui public: static Result> load(const os::Path& path); - Result handle_mouse_move(Point position) override; - Result handle_mouse_leave() override; - Result handle_mouse_down(Point position, int buttons) override; - Result handle_mouse_up(Point position, int buttons) override; Result draw(Canvas& canvas) override; private: diff --git a/libui/include/ui/Widget.h b/libui/include/ui/Widget.h index cd40f1bd..f93e832b 100644 --- a/libui/include/ui/Widget.h +++ b/libui/include/ui/Widget.h @@ -8,6 +8,7 @@ */ #pragma once +#include #include #include #include @@ -26,10 +27,28 @@ namespace ui class Widget { public: - virtual Result handle_mouse_move(Point position); - virtual Result handle_mouse_down(Point position, int buttons); - virtual Result handle_mouse_up(Point position, int buttons); - virtual Result handle_mouse_leave(); + virtual Result handle_mouse_move(Point position) + { + ignore(position); + return EventResult::DidNotHandle; + } + + virtual Result handle_mouse_down(Point position, int buttons) + { + ignore(position, buttons); + return EventResult::DidNotHandle; + } + + virtual Result handle_mouse_up(Point position, int buttons) + { + ignore(position, buttons); + return EventResult::DidNotHandle; + } + + virtual Result handle_mouse_leave() + { + return EventResult::DidNotHandle; + } virtual Result draw(Canvas& canvas); diff --git a/libui/src/Image.cpp b/libui/src/Image.cpp index 70db97bc..f8b9d7f3 100644 --- a/libui/src/Image.cpp +++ b/libui/src/Image.cpp @@ -40,26 +40,6 @@ namespace ui return widget; } - Result ImageWidget::handle_mouse_move(Point) - { - return EventResult::DidNotHandle; - } - - Result ImageWidget::handle_mouse_leave() - { - return EventResult::DidNotHandle; - } - - Result ImageWidget::handle_mouse_up(Point, int) - { - return EventResult::DidNotHandle; - } - - Result ImageWidget::handle_mouse_down(Point, int) - { - return EventResult::DidNotHandle; - } - Result ImageWidget::draw(Canvas& canvas) { canvas.subcanvas({ 0, 0, m_image->width(), m_image->height() }).fill(m_image->pixels(), m_image->width());