Fix pane grid mouse interactions
- Use `grabbing` interaction while dragging - Ignore grab interaction when dragging is disabled
This commit is contained in:
parent
69e288cad1
commit
dca99f35e9
2 changed files with 4 additions and 2 deletions
|
|
@ -341,6 +341,7 @@ where
|
||||||
cursor_position,
|
cursor_position,
|
||||||
viewport,
|
viewport,
|
||||||
renderer,
|
renderer,
|
||||||
|
self.on_drag.is_some(),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.max()
|
.max()
|
||||||
|
|
@ -648,7 +649,7 @@ pub fn mouse_interaction(
|
||||||
resize_leeway: Option<u16>,
|
resize_leeway: Option<u16>,
|
||||||
) -> Option<mouse::Interaction> {
|
) -> Option<mouse::Interaction> {
|
||||||
if action.picked_pane().is_some() {
|
if action.picked_pane().is_some() {
|
||||||
return Some(mouse::Interaction::Grab);
|
return Some(mouse::Interaction::Grabbing);
|
||||||
}
|
}
|
||||||
|
|
||||||
let resize_axis =
|
let resize_axis =
|
||||||
|
|
|
||||||
|
|
@ -238,6 +238,7 @@ where
|
||||||
cursor_position: Point,
|
cursor_position: Point,
|
||||||
viewport: &Rectangle,
|
viewport: &Rectangle,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
drag_enabled: bool,
|
||||||
) -> mouse::Interaction {
|
) -> mouse::Interaction {
|
||||||
let (body_layout, title_bar_interaction) =
|
let (body_layout, title_bar_interaction) =
|
||||||
if let Some(title_bar) = &self.title_bar {
|
if let Some(title_bar) = &self.title_bar {
|
||||||
|
|
@ -247,7 +248,7 @@ where
|
||||||
let is_over_pick_area = title_bar
|
let is_over_pick_area = title_bar
|
||||||
.is_over_pick_area(title_bar_layout, cursor_position);
|
.is_over_pick_area(title_bar_layout, cursor_position);
|
||||||
|
|
||||||
if is_over_pick_area {
|
if is_over_pick_area && drag_enabled {
|
||||||
return mouse::Interaction::Grab;
|
return mouse::Interaction::Grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue