Fix click-through behaviour of git panel
Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
parent
8b3b1a6074
commit
cc88bff1ff
1 changed files with 12 additions and 13 deletions
|
@ -482,20 +482,19 @@ impl<'a> WindowContext<'a> {
|
||||||
|
|
||||||
// If there is already clicked_button stored, don't replace it.
|
// If there is already clicked_button stored, don't replace it.
|
||||||
if self.window.clicked_button.is_none() {
|
if self.window.clicked_button.is_none() {
|
||||||
self.window.clicked_region_ids = self
|
let window = &mut *self.window;
|
||||||
.window
|
window.clicked_region_ids.clear();
|
||||||
.mouse_regions
|
|
||||||
.iter()
|
|
||||||
.filter_map(|(region, _)| {
|
|
||||||
if region.bounds.contains_point(e.position) {
|
|
||||||
Some(region.id())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
self.window.clicked_button = Some(e.button);
|
let mut highest_z_index = 0;
|
||||||
|
for (region, z_index) in window.mouse_regions.iter() {
|
||||||
|
if region.bounds.contains_point(e.position) && *z_index >= highest_z_index {
|
||||||
|
highest_z_index = *z_index;
|
||||||
|
window.clicked_region_ids.clear();
|
||||||
|
window.clicked_region_ids.insert(region.id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.clicked_button = Some(e.button);
|
||||||
}
|
}
|
||||||
|
|
||||||
mouse_events.push(MouseEvent::Down(MouseDown {
|
mouse_events.push(MouseEvent::Down(MouseDown {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue