Branches - fix settings the designer barfed on in a previous commit, and a bit of cleanup

This commit is contained in:
adelikat 2020-09-27 10:35:58 -05:00
parent cc66ba81c9
commit 6a09bbce38
2 changed files with 6 additions and 8 deletions

View File

@ -148,14 +148,17 @@
this.BranchView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.BranchView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.BranchView.CellWidthPadding = 3;
this.BranchView.CellHeightPadding = 0; this.BranchView.CellHeightPadding = 0;
this.BranchView.ChangeSelectionWhenPaging = true; this.BranchView.ChangeSelectionWhenPaging = false;
this.BranchView.ContextMenuStrip = this.BranchesContextMenu; this.BranchView.ContextMenuStrip = this.BranchesContextMenu;
this.BranchView.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.BranchView.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.BranchView.FullRowSelect = true; this.BranchView.FullRowSelect = true;
this.BranchView.GridLines = true;
this.BranchView.HorizontalOrientation = false; this.BranchView.HorizontalOrientation = false;
this.BranchView.LetKeysModifySelection = false; this.BranchView.LetKeysModifySelection = false;
this.BranchView.Location = new System.Drawing.Point(6, 19); this.BranchView.Location = new System.Drawing.Point(6, 19);
this.BranchView.MultiSelect = true;
this.BranchView.Name = "BranchView"; this.BranchView.Name = "BranchView";
this.BranchView.RowCount = 0; this.BranchView.RowCount = 0;
this.BranchView.ScrollSpeed = 13; this.BranchView.ScrollSpeed = 13;

View File

@ -208,12 +208,6 @@ namespace BizHawk.Client.EmuHawk
Tastudio.RefreshDialog(); Tastudio.RefreshDialog();
} }
private void UpdateBranch(TasBranch branch)
{
Branches.Replace(branch, CreateBranch());
Tastudio.RefreshDialog();
}
private void LoadSelectedBranch() private void LoadSelectedBranch()
{ {
if (SelectedBranch != null) if (SelectedBranch != null)
@ -290,7 +284,8 @@ namespace BizHawk.Client.EmuHawk
toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Update"); toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Update");
_branchUndo = BranchUndo.Update; _branchUndo = BranchUndo.Update;
UpdateBranch(SelectedBranch); Branches.Replace(SelectedBranch, CreateBranch());
Tastudio.RefreshDialog();
SavedCallback?.Invoke(Branches.Current); SavedCallback?.Invoke(Branches.Current);
Tastudio.MainForm.AddOnScreenMessage($"Saved branch {Branches.Current}"); Tastudio.MainForm.AddOnScreenMessage($"Saved branch {Branches.Current}");
} }