glory_render/drag.rs
1//! Logical drag phases. Coordinates use viewport CSS pixels in every host.
2/// Immediate primary-pointer capture on a boxed View. Applications provide
3/// separate semantic keyboard controls; capture does not invent a control role.
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum DragCapture {
6 /// Preserve the current actual focus, such as an adjacent text editor.
7 Press,
8 /// Focus the View, which must declare Programmatic or TabStop focus.
9 PressFocus,
10}
11impl DragCapture {
12 pub fn as_str(self) -> &'static str {
13 match self {
14 Self::Press => "press",
15 Self::PressFocus => "press-focus",
16 }
17 }
18}
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum DragPhase {
21 Start,
22 Move,
23 Drop,
24 Cancel,
25}