Fix some drag and drop issues including the mouse cursor not being locked to pointer, tooltips being incorrect when a dragged tab is used, and some subscription leaks from panes
This commit is contained in:
@@ -5103,6 +5103,7 @@ impl<T: Entity> From<WeakModelHandle<T>> for AnyWeakModelHandle {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct WeakViewHandle<T> {
|
||||
window_id: usize,
|
||||
view_id: usize,
|
||||
|
||||
@@ -381,7 +381,12 @@ impl Presenter {
|
||||
}
|
||||
}
|
||||
MouseRegionEvent::Click(e) => {
|
||||
if e.button == self.clicked_button.unwrap() {
|
||||
// Only raise click events if the released button is the same as the one stored
|
||||
if self
|
||||
.clicked_button
|
||||
.map(|clicked_button| clicked_button == e.button)
|
||||
.unwrap_or(false)
|
||||
{
|
||||
// Clear clicked regions and clicked button
|
||||
let clicked_regions =
|
||||
std::mem::replace(&mut self.clicked_regions, Vec::new());
|
||||
|
||||
@@ -169,7 +169,7 @@ impl MouseRegionEvent {
|
||||
match self {
|
||||
MouseRegionEvent::Move(_) => true,
|
||||
MouseRegionEvent::Drag(_) => false,
|
||||
MouseRegionEvent::Hover(_) => true,
|
||||
MouseRegionEvent::Hover(_) => false,
|
||||
MouseRegionEvent::Down(_) => true,
|
||||
MouseRegionEvent::Up(_) => true,
|
||||
MouseRegionEvent::Click(_) => true,
|
||||
|
||||
Reference in New Issue
Block a user