egui_pop_viewport/
mounts.rs1use egui_pop_core::model::mount::{ClaimKey, Display, HostOffer, HostSize, Keyboard, Mountable};
6
7pub const VIEWPORT: &str = "viewport";
9pub const NAVIGATOR: &str = "navigator";
11pub const NODE_GRAPH: &str = "node-graph";
13pub const CURVES: &str = "curves";
15pub const WHEELS: &str = "wheels";
17pub const HISTOGRAM: &str = "histogram";
19pub const THUMBNAIL: &str = "thumbnail";
21pub const OVERLAY: &str = "viewport.overlay";
23
24pub fn viewport() -> Mountable {
26 Mountable::new(VIEWPORT, "Image viewport")
27 .crate_name("egui-pop-viewport")
28 .keyboard(Keyboard::Hover)
29 .claims(&[ClaimKey::Space, ClaimKey::Escape])
30 .drag()
31 .wheel()
32 .cursor_images()
33 .bounded_workers()
34 .keep_under_modal()
35 .display(Display::WideWanted)
36 .fills()
37 .role("image")
38}
39
40pub fn navigator() -> Mountable {
42 Mountable::new(NAVIGATOR, "Navigator")
43 .crate_name("egui-pop-viewport")
44 .drag()
45 .wheel()
46 .min(120.0, 80.0)
47 .max(320.0, 214.0)
48 .aspect(1.5)
49 .role("image")
50}
51
52pub fn node_graph() -> Mountable {
54 Mountable::new(NODE_GRAPH, "Node graph")
55 .crate_name("egui-pop-viewport")
56 .claims(&[ClaimKey::Escape, ClaimKey::Space])
57 .keymap()
58 .drag()
59 .wheel()
60 .fills()
61 .session()
62 .role("group")
63}
64
65pub fn curves() -> Mountable {
67 Mountable::new(CURVES, "Curves")
68 .crate_name("egui-pop-viewport")
69 .claims(&[ClaimKey::Escape])
70 .drag()
71 .min(120.0, 120.0)
72 .max(320.0, 320.0)
73 .aspect(1.0)
74 .role("image")
75}
76
77pub fn wheels() -> Mountable {
79 Mountable::new(WHEELS, "Wheels")
80 .crate_name("egui-pop-viewport")
81 .claims(&[ClaimKey::Escape])
82 .drag()
83 .min(48.0, 48.0)
84 .preferred(160.0, 160.0)
85 .aspect(1.0)
86 .role("slider")
87}
88
89pub fn histogram() -> Mountable {
91 Mountable::new(HISTOGRAM, "Histogram")
92 .crate_name("egui-pop-viewport")
93 .claims(&[ClaimKey::Escape])
94 .drag()
95 .min(120.0, 40.0)
96 .max(600.0, 200.0)
97 .role("image")
98 .preview()
99}
100
101pub fn thumbnail() -> Mountable {
103 Mountable::new(THUMBNAIL, "Thumbnail")
104 .crate_name("egui-pop-viewport")
105 .keyboard(Keyboard::None)
106 .min(16.0, 16.0)
107 .preferred(96.0, 72.0)
108 .role("image")
109 .preview()
110}
111
112pub fn components() -> Vec<Mountable> {
114 vec![
115 viewport(),
116 navigator(),
117 node_graph(),
118 curves(),
119 wheels(),
120 histogram(),
121 thumbnail(),
122 ]
123}
124
125pub fn overlay_host() -> HostOffer {
128 HostOffer::new(OVERLAY, "V", "Viewport overlay")
129 .source("egui_pop_viewport::overlay")
130 .size(HostSize::NoUi)
131 .focus(egui_pop_core::model::mount::FocusPolicy::None)
132 .window(egui_pop_core::model::mount::Window::FollowsPanel)
133 .keymap(false)
134 .gives_app(false)
135 .scope(false)
136 .fault_boundary(false)
137}