Add deadband distance before initiating drag action on pane grid
This commit is contained in:
parent
dd249a1d11
commit
116fb666b0
2 changed files with 68 additions and 18 deletions
|
|
@ -403,6 +403,15 @@ pub enum Action {
|
|||
///
|
||||
/// [`PaneGrid`]: super::PaneGrid
|
||||
Idle,
|
||||
/// A [`Pane`] in the [`PaneGrid`] is being clicked.
|
||||
///
|
||||
/// [`PaneGrid`]: super::PaneGrid
|
||||
Clicking {
|
||||
/// The [`Pane`] being clicked.
|
||||
pane: Pane,
|
||||
/// The starting [`Point`] of the click interaction.
|
||||
origin: Point,
|
||||
},
|
||||
/// A [`Pane`] in the [`PaneGrid`] is being dragged.
|
||||
///
|
||||
/// [`PaneGrid`]: super::PaneGrid
|
||||
|
|
@ -432,6 +441,14 @@ impl Action {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns the current [`Pane`] that is being clicked, if any.
|
||||
pub fn clicked_pane(&self) -> Option<(Pane, Point)> {
|
||||
match *self {
|
||||
Action::Clicking { pane, origin, .. } => Some((pane, origin)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the current [`Split`] that is being dragged, if any.
|
||||
pub fn picked_split(&self) -> Option<(Split, Axis)> {
|
||||
match *self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue