collab_ui: remove branch menu popover in favor of opening a modal (#12562)
This commit also removes a bunch of dead code. Fixes #12544 Release Notes: - Removed branch popover menu - clicking on the branch name in left-hand corner now always opens a branch modal
This commit is contained in:
parent
fbcc5ccdb9
commit
f0d979576d
3 changed files with 22 additions and 51 deletions
|
@ -21,7 +21,7 @@ actions!(branches, [OpenRecent]);
|
|||
pub fn init(cx: &mut AppContext) {
|
||||
cx.observe_new_views(|workspace: &mut Workspace, _| {
|
||||
workspace.register_action(|workspace, action, cx| {
|
||||
BranchList::toggle_modal(workspace, action, cx).log_err();
|
||||
BranchList::open(workspace, action, cx).log_err();
|
||||
});
|
||||
})
|
||||
.detach();
|
||||
|
@ -43,7 +43,7 @@ impl BranchList {
|
|||
_subscription,
|
||||
}
|
||||
}
|
||||
fn toggle_modal(
|
||||
pub fn open(
|
||||
workspace: &mut Workspace,
|
||||
_: &OpenRecent,
|
||||
cx: &mut ViewContext<Workspace>,
|
||||
|
@ -77,16 +77,6 @@ impl Render for BranchList {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn build_branch_list(
|
||||
workspace: View<Workspace>,
|
||||
cx: &mut WindowContext<'_>,
|
||||
) -> Result<View<BranchList>> {
|
||||
let delegate = workspace.update(cx, |workspace, cx| {
|
||||
BranchListDelegate::new(workspace, cx.view().clone(), 29, cx)
|
||||
})?;
|
||||
Ok(cx.new_view(move |cx| BranchList::new(delegate, 20., cx)))
|
||||
}
|
||||
|
||||
pub struct BranchListDelegate {
|
||||
matches: Vec<StringMatch>,
|
||||
all_branches: Vec<Branch>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue