diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 73c6685825..e7f8e847cc 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -1415,6 +1415,7 @@ namespace BizHawk.Client.EmuHawk this.BranchesMarkersSplit.Size = new System.Drawing.Size(204, 436); this.BranchesMarkersSplit.SplitterDistance = 169; this.BranchesMarkersSplit.TabIndex = 9; + this.BranchesMarkersSplit.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.BranchesMarkersSplit_SplitterMoved); // // MainVertialSplit // @@ -1436,6 +1437,7 @@ namespace BizHawk.Client.EmuHawk this.MainVertialSplit.Size = new System.Drawing.Size(507, 528); this.MainVertialSplit.SplitterDistance = 295; this.MainVertialSplit.TabIndex = 10; + this.MainVertialSplit.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.MainVertialSplit_SplitterMoved); // // TAStudio // diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 92782e0727..169aee13ff 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -64,6 +64,9 @@ namespace BizHawk.Client.EmuHawk public int ScrollSpeed { get; set; } public bool FollowCursorAlwaysScroll { get; set; } public string FollowCursorScrollMethod { get; set; } + + public int MainVerticalSplitDistance { get; set; } + public int BranchMarkerSplitDistance { get; set; } } public TasMovie CurrentTasMovie @@ -169,6 +172,35 @@ namespace BizHawk.Client.EmuHawk if (!string.IsNullOrEmpty(Settings.FollowCursorScrollMethod)) // Better default here too? TasView.ScrollMethod = Settings.FollowCursorScrollMethod; + // Remembering Split container logic + int defaultMainSplitDistance = MainVertialSplit.SplitterDistance; + int defaultBranchMarkerSplitDistance = BranchesMarkersSplit.SplitterDistance; + + ToolStripMenuItem restoreDefaults = TASMenu.Items + .OfType() + .Single(t => t.Name == "SettingsSubMenu") + .DropDownItems + .OfType() + .Single(t => t.Text == "Restore &Defaults"); + + restoreDefaults.Click += (o, ev) => + { + MainVertialSplit.SplitterDistance = defaultMainSplitDistance; + BranchesMarkersSplit.SplitterDistance = defaultBranchMarkerSplitDistance; + }; + + if (Settings.MainVerticalSplitDistance > 0) + { + MainVertialSplit.SplitterDistance = Settings.MainVerticalSplitDistance; + } + + if (Settings.BranchMarkerSplitDistance > 0) + { + BranchesMarkersSplit.SplitterDistance = Settings.BranchMarkerSplitDistance; + } + + //////////////// + RefreshDialog(); _initialized = true; } @@ -829,5 +861,15 @@ namespace BizHawk.Client.EmuHawk if (e.KeyCode == Keys.F) TasPlaybackBox.FollowCursor ^= true; } + + private void MainVertialSplit_SplitterMoved(object sender, SplitterEventArgs e) + { + Settings.MainVerticalSplitDistance = MainVertialSplit.SplitterDistance; + } + + private void BranchesMarkersSplit_SplitterMoved(object sender, SplitterEventArgs e) + { + Settings.BranchMarkerSplitDistance = BranchesMarkersSplit.SplitterDistance; + } } }