32 lines
693 B
C++
32 lines
693 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_mousemove(Point position) override;
|
|
Result<void> draw(Canvas& canvas) override;
|
|
|
|
private:
|
|
Widget* m_widget;
|
|
VerticalAlignment m_valign;
|
|
HorizontalAlignment m_halign;
|
|
};
|
|
}
|