Skip to content

Commit 2bb58c7

Browse files
committed
fix double click column index check for arguments & platform
1 parent 2d1f809 commit 2bb58c7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,12 +1534,15 @@ private void GridRecent_PreviewKeyDown(object sender, KeyEventArgs e)
15341534
// if edit mode, dont override keys
15351535
if (IsEditingCell(gridRecent) == true) return;
15361536
// if in args column, dont jump to end of list, but end of this field
1537-
if (gridRecent.CurrentCell.Column.DisplayIndex == 4)
1537+
1538+
var currentColumnCell = gridRecent.CurrentCell.Column.Header.ToString();
1539+
if (currentColumnCell == "Arguments")
15381540
{
15391541
// start editing this cell
15401542
gridRecent.BeginEdit();
15411543
return;
15421544
}
1545+
15431546
gridRecent.SelectedIndex = gridRecent.Items.Count - 1;
15441547
gridRecent.ScrollIntoView(gridRecent.SelectedItem);
15451548
e.Handled = true;
@@ -2024,8 +2027,11 @@ private void GridRecent_PreviewMouseDoubleClick(object sender, MouseButtonEventA
20242027
if (e.OriginalSource.GetType() != typeof(TextBlock)) return;
20252028

20262029
// cancel run if double clicked Arguments or Platform editable field
2027-
var currentColumnCell = gridRecent.CurrentCell.Column.DisplayIndex;
2028-
if (currentColumnCell == 4 || currentColumnCell == 6) return;
2030+
var currentColumnCell = gridRecent.CurrentCell.Column.Header.ToString();
2031+
if (currentColumnCell == "Arguments" || currentColumnCell == "Platform")
2032+
{
2033+
return;
2034+
}
20292035

20302036
var proj = GetSelectedProject();
20312037
var proc = Tools.LaunchProject(proj);

0 commit comments

Comments
 (0)