workspace: Double click empty pane to open new file (#27521)
Release Notes: - Added ability to double click on empty pane to open a new file
This commit is contained in:
parent
780d0eb427
commit
999ad77a59
1 changed files with 17 additions and 2 deletions
|
@ -3315,13 +3315,28 @@ impl Render for Pane {
|
||||||
})
|
})
|
||||||
.map(|div| {
|
.map(|div| {
|
||||||
if let Some(item) = self.active_item() {
|
if let Some(item) = self.active_item() {
|
||||||
div.v_flex()
|
div.id("pane_placeholder")
|
||||||
|
.v_flex()
|
||||||
.size_full()
|
.size_full()
|
||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.child(self.toolbar.clone())
|
.child(self.toolbar.clone())
|
||||||
.child(item.to_any())
|
.child(item.to_any())
|
||||||
} else {
|
} else {
|
||||||
let placeholder = div.h_flex().size_full().justify_center();
|
let placeholder = div
|
||||||
|
.id("pane_placeholder")
|
||||||
|
.h_flex()
|
||||||
|
.size_full()
|
||||||
|
.justify_center()
|
||||||
|
.on_click(cx.listener(
|
||||||
|
move |this, event: &ClickEvent, window, cx| {
|
||||||
|
if event.up.click_count == 2 {
|
||||||
|
window.dispatch_action(
|
||||||
|
this.double_click_dispatch_action.boxed_clone(),
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
));
|
||||||
if has_worktrees {
|
if has_worktrees {
|
||||||
placeholder
|
placeholder
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue