From 12981dc6dfad69931fd22871e387ff87c0ee5f03 Mon Sep 17 00:00:00 2001
From: Morilli <35152647+Morilli@users.noreply.github.com>
Date: Thu, 27 Jun 2024 02:45:06 +0200
Subject: [PATCH] Add column name tooltip to column headers in TAStudio
- closes #3124
---
.../CustomControls/InputRoll/InputRoll.cs | 2 +-
.../tools/TAStudio/TAStudio.Designer.cs | 2 ++
.../tools/TAStudio/TAStudio.ListView.cs | 2 ++
src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 8 ++++++++
src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.resx | 3 +++
5 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs
index 86f99c4600..4b4bfd1d09 100644
--- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs
+++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs
@@ -1604,7 +1604,7 @@ namespace BizHawk.Client.EmuHawk
PointedCellChanged(this, new CellEventArgs(_lastCell, CurrentCell));
}
- if (CurrentCell?.Column != null && CurrentCell.RowIndex.HasValue)
+ if (CurrentCell?.Column is not null)
{
_hoverTimer.Start();
}
diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs
index 8ea991774e..f08812e911 100644
--- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs
+++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs
@@ -193,6 +193,7 @@ namespace BizHawk.Client.EmuHawk
this.BookMarkControl = new BizHawk.Client.EmuHawk.BookmarksBranchesBox();
this.BranchesMarkersSplit = new System.Windows.Forms.SplitContainer();
this.MainVertialSplit = new System.Windows.Forms.SplitContainer();
+ this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.TASMenu.SuspendLayout();
this.TasStatusStrip.SuspendLayout();
this.RightClickMenu.SuspendLayout();
@@ -1385,5 +1386,6 @@ namespace BizHawk.Client.EmuHawk
private BizHawk.WinForms.Controls.ToolStripMenuItemEx LoadBranchOnDoubleclickMenuItem;
private BizHawk.WinForms.Controls.ToolStripMenuItemEx SetFontMenuItem;
private BizHawk.WinForms.Controls.ToolStripMenuItemEx CopyIncludesFrameNoMenuItem;
+ private System.Windows.Forms.ToolTip toolTip1;
}
}
\ No newline at end of file
diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs
index f70f27f92d..e43714a931 100644
--- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs
+++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs
@@ -936,6 +936,8 @@ namespace BizHawk.Client.EmuHawk
private void TasView_PointedCellChanged(object sender, InputRoll.CellEventArgs e)
{
+ toolTip1.SetToolTip(TasView, null);
+
if (e.NewCell.RowIndex is null)
{
return;
diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs
index c00b6d9cc0..d05d3f59a3 100644
--- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs
+++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs
@@ -153,6 +153,13 @@ namespace BizHawk.Client.EmuHawk
BookMarkControl.SavedCallback = BranchSaved;
BookMarkControl.RemovedCallback = BranchRemoved;
TasView.MouseLeave += TAStudio_MouseLeave;
+ TasView.CellHovered += (_, e) =>
+ {
+ if (e.NewCell.RowIndex is null)
+ {
+ toolTip1.Show(e.NewCell.Column!.Name, TasView, PointToClient(Cursor.Position));
+ }
+ };
}
private void Tastudio_Load(object sender, EventArgs e)
@@ -1146,6 +1153,7 @@ namespace BizHawk.Client.EmuHawk
private void TAStudio_MouseLeave(object sender, EventArgs e)
{
+ toolTip1.SetToolTip(TasView, null);
DoTriggeredAutoRestoreIfNeeded();
}
diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.resx b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.resx
index 13e8b47399..2de40e6376 100644
--- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.resx
+++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.resx
@@ -126,4 +126,7 @@
249, 17
+
+ 388, 17
+
\ No newline at end of file