#pragma once
#include "widget/mpanel_widget.h"

struct moverlay_slot : mpanel_widget_slot<moverlay_slot> {
	SLOT_ATTRIBUTE(margin_t, margin)
	SLOT_ATTRIBUTE(float, opacity)
	SLOT_ATTRIBUTE(float, z_index)
	SLOT_ATTRIBUTE(horizontal_alignment_t, h_alignment)
	SLOT_ATTRIBUTE(vertical_alignment_t, v_alignment)

	// 	/**
	// 	 * @brief 构造函数，设置默认对齐方式
	// 	 *
	// 	 * 初始化插槽，默认将子组件在水平和垂直方向上都设为拉伸填充模式
	// 	 */
public:
	moverlay_slot() {
		h_alignment(horizontal_alignment_t::stretch);
		v_alignment(vertical_alignment_t::stretch);
	}
};

class moverlay : public mpanel_widget<moverlay_slot> {
public:
	void arrange_children(const geometry_t& in_allotted_geometry) override;
	auto compute_desired_size(float in_layout_scale_multiplier) const -> Eigen::Vector2f override;
};
