/** * @file Container.h * @author apio (cloudapio.eu) * @brief A container widget to pad and align objects inside it. * * @copyright Copyright (c) 2023, the Luna authors. * */ #pragma once #include #include namespace ui { class Container : public Widget { public: Container(Rect rect, VerticalAlignment valign, HorizontalAlignment halign); void set_widget(Widget& widget); 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 handle_key_event(const ui::KeyEventRequest& request) override; Result draw(Canvas& canvas) override; private: Widget* m_widget; VerticalAlignment m_valign; HorizontalAlignment m_halign; }; }