bevy_ui_builders/dialog/
types.rs1use bevy::prelude::*;
4
5#[derive(Component, Debug, Clone)]
7pub struct DialogOverlay {
8 pub dialog_type: DialogType,
9 pub dismissible: bool,
10}
11
12#[derive(Debug, Clone, Copy, PartialEq, Eq)]
14pub enum DialogType {
15 ExitConfirmation,
17 UnsavedChanges,
19 Resolution,
21 Error,
23 Info,
25 Warning,
27 Success,
29 Custom,
31}
32
33#[derive(Component, Debug)]
35pub struct DialogContainer {
36 pub dialog_type: DialogType,
37}
38
39#[derive(Component)]
41pub struct DialogTitle;
42
43#[derive(Component)]
45pub struct DialogBody;
46
47#[derive(Component)]
49pub struct DialogButtonRow;
50
51#[derive(Component)]
53pub struct ExitConfirmationDialog;
54
55#[derive(Component)]
57pub struct UnsavedChangesDialog;
58
59#[derive(Component)]
61pub struct ResolutionDialog;
62
63#[derive(Component)]
65pub struct ErrorDialog;
66
67#[derive(Component)]
69pub struct InfoDialog;
70
71#[derive(Component)]
73pub struct WarningDialog;
74
75#[derive(Component)]
77pub struct SuccessDialog;
78
79#[derive(Component)]
81pub struct ConfirmButton;
82
83#[derive(Component)]
84pub struct CancelButton;
85
86#[derive(Component)]
87pub struct SaveButton;
88
89#[derive(Component)]
90pub struct DiscardButton;
91
92#[derive(Component)]
93pub struct OkButton;
94
95#[derive(Component)]
96pub struct YesButton;
97
98#[derive(Component)]
99pub struct NoButton;
100
101pub struct DialogButton {
103 pub text: String,
104 pub style: crate::ButtonStyle,
105 pub marker: DialogButtonMarker,
106}
107
108#[derive(Debug, Clone, Hash, PartialEq, Eq)]
110pub enum DialogButtonMarker {
111 Confirm,
112 Cancel,
113 Save,
114 Discard,
115 Ok,
116 Yes,
117 No,
118 Custom(String),
119}