Tastudio branches - when removing the selected branch, clear the selection color

This commit is contained in:
adelikat 2015-07-25 20:55:23 -04:00
parent c969c57ee9
commit 0963c17206
2 changed files with 13 additions and 1 deletions

View File

@ -146,13 +146,20 @@ namespace BizHawk.Client.EmuHawk
{
if (SelectedBranch != null)
{
if (Branches.IndexOf(SelectedBranch) == CurrentBranch)
int index = Branches.IndexOf(SelectedBranch);
if (index == CurrentBranch)
{
CurrentBranch = -1;
}
Branches.Remove(SelectedBranch);
BranchView.RowCount = Branches.Count;
if (index == BranchView.SelectedRows.FirstOrDefault())
{
BranchView.ClearSelectedRows();
}
BranchView.Refresh();
}
}

View File

@ -840,6 +840,11 @@ namespace BizHawk.Client.EmuHawk
}
}
public void ClearSelectedRows()
{
SelectedItems.Clear();
}
public IEnumerable<ToolStripItem> GenerateContextMenuItems()
{
yield return new ToolStripSeparator();