Fix mouse interrupting file/dir editing in project panel

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Petros AmoiridisandAntonio Scandurra committed 2023-01-18 15:22:20 +02:00
1 parent 4379d9b544
commit 3aa41f7cc5
1 file changed
+9 -7
+9 -7
View File
@@ -1176,13 +1176,15 @@ impl ProjectPanel {
)
})
.on_click(MouseButton::Left, move |e, cx| {
if kind == EntryKind::Dir {
cx.dispatch_action(ToggleExpanded(entry_id))
} else {
cx.dispatch_action(Open {
entry_id,
change_focus: e.click_count > 1,
})
if !show_editor {
if kind == EntryKind::Dir {
cx.dispatch_action(ToggleExpanded(entry_id))
} else {
cx.dispatch_action(Open {
entry_id,
change_focus: e.click_count > 1,
})
}
}
})
.on_down(MouseButton::Right, move |e, cx| {