bevy_ui_builders/progress/
types.rs1use bevy::prelude::*;
4
5#[derive(Component, Debug)]
7pub struct ProgressBar {
8 pub value: f32, pub style: ProgressBarStyle,
10 pub animated: bool,
11}
12
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
15pub enum ProgressBarStyle {
16 #[default]
17 Default, Thin, Thick, Segmented, }
22
23impl ProgressBarStyle {
24 pub fn height(&self) -> f32 {
25 match self {
26 ProgressBarStyle::Thin => 4.0,
27 ProgressBarStyle::Thick => 12.0,
28 _ => 8.0,
29 }
30 }
31
32 pub fn track_color(&self) -> Color {
33 crate::colors::BACKGROUND_DARK
34 }
35
36 pub fn fill_color(&self) -> Color {
37 crate::colors::PRIMARY
38 }
39}
40
41#[derive(Component)]
43pub struct ProgressBarFill;
44
45#[derive(Component)]
47pub struct ProgressBarTrack;
48
49#[derive(Component)]
51pub struct ProgressBarLabel;