layer_shika_domain/value_objects/
popup_config.rs1use crate::value_objects::handle::PopupHandle;
2use crate::value_objects::output_target::OutputTarget;
3use crate::value_objects::popup_behavior::PopupBehavior;
4use crate::value_objects::popup_position::{Offset, PopupPosition};
5use crate::value_objects::popup_size::PopupSize;
6
7#[derive(Debug, Clone)]
9pub struct PopupConfig {
10 pub component: String,
12
13 pub position: PopupPosition,
15
16 pub size: PopupSize,
18
19 pub behavior: PopupBehavior,
21
22 pub output: OutputTarget,
24
25 pub parent: Option<PopupHandle>,
27
28 pub z_index: i32,
30
31 pub close_callback: Option<String>,
33
34 pub resize_callback: Option<String>,
36}
37
38impl PopupConfig {
39 #[must_use]
40 pub fn new(component: impl Into<String>) -> Self {
41 Self {
42 component: component.into(),
43 position: PopupPosition::Cursor {
44 offset: Offset::default(),
45 },
46 size: PopupSize::default(),
47 behavior: PopupBehavior::default(),
48 output: OutputTarget::Active,
49 parent: None,
50 z_index: 0,
51 close_callback: None,
52 resize_callback: None,
53 }
54 }
55}