apio
140910763e
All checks were successful
Build and test / build (push) Successful in 1m56s
Why are command-line utilities stored in "apps"? And why are apps like "editor" or "terminal" top-level directories? Command-line utilities now go in "utils". GUI stuff now goes in "gui". This includes: libui -> gui/libui, wind -> gui/wind, GUI apps -> gui/apps, editor&terminal -> gui/apps... System services go in "system".
36 lines
1012 B
C++
36 lines
1012 B
C++
/**
|
|
* @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 <ui/Alignment.h>
|
|
#include <ui/Widget.h>
|
|
|
|
namespace ui
|
|
{
|
|
class Container : public Widget
|
|
{
|
|
public:
|
|
Container(Rect rect, VerticalAlignment valign, HorizontalAlignment halign);
|
|
|
|
void set_widget(Widget& widget);
|
|
|
|
Result<EventResult> handle_mouse_move(Point position) override;
|
|
Result<EventResult> handle_mouse_leave() override;
|
|
Result<EventResult> handle_mouse_down(Point position, int buttons) override;
|
|
Result<EventResult> handle_mouse_up(Point position, int buttons) override;
|
|
Result<EventResult> handle_key_event(const ui::KeyEventRequest& request) override;
|
|
Result<void> draw(Canvas& canvas) override;
|
|
|
|
private:
|
|
Widget* m_widget;
|
|
VerticalAlignment m_valign;
|
|
HorizontalAlignment m_halign;
|
|
};
|
|
}
|