change TAStudio layout when rotation changes

- addresses #3708
This commit is contained in:
Morilli 2025-03-16 21:56:31 +01:00
parent 8efeda8af9
commit 1e397432af
4 changed files with 22 additions and 11 deletions

View File

@ -477,6 +477,10 @@ namespace BizHawk.Client.EmuHawk
[Description("Occurs when a cell is dragged and then dropped into a new cell, old cell is the cell that was being dragged, new cell is its new destination")]
public event CellDroppedEvent CellDropped;
[Category("Property Changed")]
[Description("Fires after rotation has been changed.")]
public event EventHandler RotationChanged;
/// <summary>
/// Retrieve the text for a cell
/// </summary>
@ -1568,6 +1572,7 @@ namespace BizHawk.Client.EmuHawk
private void OrientationChanged()
{
RotationChanged?.Invoke(this, EventArgs.Empty);
// TODO scroll to correct positions
ColumnChangedCallback();
Refresh();

View File

@ -895,6 +895,7 @@ namespace BizHawk.Client.EmuHawk
this.TasView.RightMouseScrolled += new BizHawk.Client.EmuHawk.InputRoll.RightMouseScrollEventHandler(this.TasView_MouseWheel);
this.TasView.ColumnReordered += new BizHawk.Client.EmuHawk.InputRoll.ColumnReorderedEventHandler(this.TasView_ColumnReordered);
this.TasView.CellDropped += new BizHawk.Client.EmuHawk.InputRoll.CellDroppedEvent(this.TasView_CellDropped);
this.TasView.RotationChanged += new System.EventHandler(this.HandleRotationChanged);
this.TasView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TasView_KeyDown);
this.TasView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseDoubleClick);
this.TasView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseDown);

View File

@ -1019,7 +1019,6 @@ namespace BizHawk.Client.EmuHawk
private void RotateMenuItem_Click(object sender, EventArgs e)
{
TasView.HorizontalOrientation = !TasView.HorizontalOrientation;
CurrentTasMovie.FlagChanges();
}
private void HideLagFramesX_Click(object sender, EventArgs e)

View File

@ -180,16 +180,7 @@ namespace BizHawk.Client.EmuHawk
return;
}
if (TasView.Rotatable)
{
RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems()
.ToArray());
RightClickMenu.Items
.OfType<ToolStripMenuItem>()
.First(t => t.Name == "RotateMenuItem")
.Click += (o, ov) => { CurrentTasMovie.FlagChanges(); };
}
RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems().ToArray());
TasView.ScrollSpeed = Settings.ScrollSpeed;
TasView.AlwaysScroll = Settings.FollowCursorAlwaysScroll;
@ -1251,5 +1242,20 @@ namespace BizHawk.Client.EmuHawk
}
}
}
private void HandleRotationChanged(object sender, EventArgs e)
{
CurrentTasMovie.FlagChanges();
if (TasView.HorizontalOrientation)
{
BranchesMarkersSplit.Orientation = Orientation.Vertical;
BranchesMarkersSplit.SplitterDistance = 200;
}
else
{
BranchesMarkersSplit.Orientation = Orientation.Horizontal;
BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance;
}
}
}
}