1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use bevy::{color::palettes::css::WHITE, prelude::*, sprite::Anchor};

use crate::widgets::button::components::CustomButtonRef;

#[derive(Component, Clone)]
pub struct PanelUi;

#[derive(Component)]
pub struct PanelText;

#[derive(Component)]
pub struct Panel<T> {
    pub text: Option<String>,
    pub texture: Option<Handle<Image>>,
    pub color: Color,
    pub text_alignment: Anchor,
    pub content: Vec<T>,
}

impl Default for Panel<CustomButtonRef> {
    fn default() -> Self {
        Self {
            text: None,
            texture: None,
            color: WHITE.into(),
            text_alignment: Anchor::TopCenter,
            content: vec![],
        }
    }
}