Tastudio - fix splitter restore logic on restore defaults
This commit is contained in:
parent
290cf4c4a4
commit
aaee3cf48c
|
@ -1403,23 +1403,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
RefreshTasView();
|
||||
CurrentTasMovie.FlagChanges();
|
||||
|
||||
try
|
||||
{
|
||||
MainVertialSplit.SplitterDistance = Settings.MainVerticalSplitDistance;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MainVertialSplit.SplitterDistance = _defaultMainSplitDistance;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
BranchesMarkersSplit.SplitterDistance = Settings.BranchMarkerSplitDistance;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance;
|
||||
}
|
||||
MainVertialSplit.SplitterDistance = _defaultMainSplitDistance;
|
||||
BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
private UndoHistoryForm _undoForm;
|
||||
private Timer _autosaveTimer;
|
||||
|
||||
private int _defaultMainSplitDistance;
|
||||
private int _defaultBranchMarkerSplitDistance;
|
||||
private readonly int _defaultMainSplitDistance;
|
||||
private readonly int _defaultBranchMarkerSplitDistance;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value that separates "restore last position" logic from seeking caused by navigation.
|
||||
|
@ -273,22 +273,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
// Remembering Split container logic
|
||||
int defaultMainSplitDistance = MainVertialSplit.SplitterDistance;
|
||||
int defaultBranchMarkerSplitDistance = BranchesMarkersSplit.SplitterDistance;
|
||||
|
||||
ToolStripMenuItem restoreDefaults = TASMenu.Items
|
||||
.OfType<ToolStripMenuItem>()
|
||||
.Single(t => t.Name == "SettingsSubMenu")
|
||||
.DropDownItems
|
||||
.OfType<ToolStripMenuItem>()
|
||||
.Single(t => t.Text == "Restore &Defaults");
|
||||
|
||||
restoreDefaults.Click += (o, ev) =>
|
||||
{
|
||||
MainVertialSplit.SplitterDistance = defaultMainSplitDistance;
|
||||
BranchesMarkersSplit.SplitterDistance = defaultBranchMarkerSplitDistance;
|
||||
};
|
||||
|
||||
if (Settings.MainVerticalSplitDistance > 0)
|
||||
{
|
||||
try
|
||||
|
@ -297,7 +281,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MainVertialSplit.SplitterDistance = defaultMainSplitDistance;
|
||||
MainVertialSplit.SplitterDistance = _defaultMainSplitDistance;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -310,7 +294,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
BranchesMarkersSplit.SplitterDistance = defaultBranchMarkerSplitDistance;
|
||||
BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// <param name="toolType">Type of tool you want to load</param>
|
||||
/// <param name="focus">Define if the tool form has to get the focus or not (Default is true)</param>
|
||||
/// <returns>An instantiated <see cref="IToolForm"/></returns>
|
||||
/// <exception cref="ArgumentException">Raised if <paramref name="toolType"/> can't be casted into IToolForm </exception>
|
||||
/// <exception cref="ArgumentException">Raised if <paramref name="toolType"/> can't cast into IToolForm </exception>
|
||||
internal IToolForm Load(Type toolType, bool focus = true)
|
||||
{
|
||||
if (!typeof(IToolForm).IsAssignableFrom(toolType))
|
||||
|
|
Loading…
Reference in New Issue