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:
K Simmons
2022-08-26 15:43:15 -07:00
parent 579c84b5e4
commit 3cc07c1099
7 changed files with 139 additions and 97 deletions
+1
View File
@@ -5103,6 +5103,7 @@ impl<T: Entity> From<WeakModelHandle<T>> for AnyWeakModelHandle {
}
}
#[derive(Debug)]
pub struct WeakViewHandle<T> {
window_id: usize,
view_id: usize,
+6 -1
View File
@@ -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());
+1 -1
View File
@@ -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,