|
|
|
@ -61,6 +61,35 @@ mod title {
|
|
|
|
pub font: Option<Handle<Font>>,
|
|
|
|
pub font: Option<Handle<Font>>,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
|
|
|
pub struct TitleBarBase {
|
|
|
|
|
|
|
|
bg_color: Color,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl TitleBarBase {
|
|
|
|
|
|
|
|
pub fn new(bg_color: Color) -> Self {
|
|
|
|
|
|
|
|
Self { bg_color }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn bundle(&self) -> NodeBundle {
|
|
|
|
|
|
|
|
NodeBundle {
|
|
|
|
|
|
|
|
style: Style {
|
|
|
|
|
|
|
|
padding: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
|
|
|
margin: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
|
|
|
border: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
|
|
|
flex_direction: FlexDirection::Row,
|
|
|
|
|
|
|
|
align_items: AlignItems::Center,
|
|
|
|
|
|
|
|
align_content: AlignContent::Center,
|
|
|
|
|
|
|
|
justify_content: JustifyContent::SpaceBetween,
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
background_color: self.bg_color.into(),
|
|
|
|
|
|
|
|
border_color: Color::BLACK.into(),
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Component)]
|
|
|
|
#[derive(Debug, Component)]
|
|
|
|
pub struct Note {
|
|
|
|
pub struct Note {
|
|
|
|
pub text: String,
|
|
|
|
pub text: String,
|
|
|
|
@ -579,25 +608,13 @@ pub mod alert {
|
|
|
|
justify_self: JustifySelf::Center,
|
|
|
|
justify_self: JustifySelf::Center,
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
background_color: Color::WHITE.into(),
|
|
|
|
border_color: color.into(),
|
|
|
|
border_color: color.into(),
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.with_children(|parent| {
|
|
|
|
.with_children(|parent| {
|
|
|
|
parent.spawn((
|
|
|
|
parent.spawn((
|
|
|
|
NodeBundle {
|
|
|
|
TitleBarBase::new(color).bundle(),
|
|
|
|
style: Style {
|
|
|
|
|
|
|
|
padding: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
|
|
|
margin: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
|
|
|
border: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
|
|
|
flex_direction: FlexDirection::Row,
|
|
|
|
|
|
|
|
align_items: AlignItems::Center,
|
|
|
|
|
|
|
|
align_content: AlignContent::Center,
|
|
|
|
|
|
|
|
justify_content: JustifyContent::SpaceBetween,
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
background_color: color.into(),
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Title {
|
|
|
|
Title {
|
|
|
|
text: "Alert".into(),
|
|
|
|
text: "Alert".into(),
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
@ -607,7 +624,13 @@ pub mod alert {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Sorting(0),
|
|
|
|
Sorting(0),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
parent.spawn(TextBundle::from_section(text, TextStyle { ..default() }));
|
|
|
|
parent.spawn(TextBundle::from_section(
|
|
|
|
|
|
|
|
text,
|
|
|
|
|
|
|
|
TextStyle {
|
|
|
|
|
|
|
|
color: Color::BLACK.into(),
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|