Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Views/Blame.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ public partial class Blame : ChromelessWindow
{
public Blame()
{
CloseOnESC = true;
InitializeComponent();
}

Expand Down
15 changes: 14 additions & 1 deletion src/Views/BranchTree.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ private void OnTreeKeyDown(object _, KeyEventArgs e)
return;
}

if (e.Key is not (Key.Delete or Key.Back))
if (e.Key is not (Key.Delete or Key.Back or Key.F2))
return;

var repo = DataContext as ViewModels.Repository;
Expand All @@ -593,6 +593,18 @@ private void OnTreeKeyDown(object _, KeyEventArgs e)
if (selected == null || selected.Count == 0)
return;

// Rename branch with F2
if (e.Key == Key.F2
&& selected.Count == 1
&& selected[0] is ViewModels.BranchTreeNode { Backend: Models.Branch branch })
{
if (branch.IsLocal && repo.CanCreatePopup())
repo.ShowPopup(new ViewModels.RenameBranch(repo, branch));

e.Handled = true;
return;
}

if (selected.Count == 1 && selected[0] is ViewModels.BranchTreeNode { Backend: Models.Remote remote })
{
repo.DeleteRemote(remote);
Expand Down Expand Up @@ -903,6 +915,7 @@ private ContextMenu CreateContextMenuForLocalBranch(ViewModels.Repository repo,
var rename = new MenuItem();
rename.Header = App.Text("BranchCM.Rename", branch.Name);
rename.Icon = this.CreateMenuIcon("Icons.Rename");
rename.Tag = "F2";
rename.Click += (_, e) =>
{
if (repo.CanCreatePopup())
Expand Down
1 change: 1 addition & 0 deletions src/Views/FileHistories.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public partial class FileHistories : ChromelessWindow
{
public FileHistories()
{
CloseOnESC = true;
InitializeComponent();
}

Expand Down