Skip to content

Commit aceead7

Browse files
committed
recent project: disable opening project from datagrid header or scrollbar double clicks (fix #106)
1 parent 1471c7f commit aceead7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: UnityLauncherPro/MainWindow.xaml

+5
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@
8484
<DataGridTextColumn x:Name="txtColumnTitle" CellStyle="{StaticResource NoFocusCellStyle}" Binding="{Binding Title}" ClipboardContentBinding="{x:Null}" Header="Project" IsReadOnly="True" Width="150"/>
8585

8686
<DataGridTextColumn Binding="{Binding Version}" ClipboardContentBinding="{x:Null}" Header="Version" IsReadOnly="True" Width="72">
87+
<DataGridTextColumn.HeaderTemplate>
88+
<DataTemplate>
89+
<TextBlock Text="Version" IsHitTestVisible="False" />
90+
</DataTemplate>
91+
</DataGridTextColumn.HeaderTemplate>
8792
<DataGridTextColumn.CellStyle>
8893
<Style TargetType="{x:Type DataGridCell}">
8994
<Setter Property="Foreground" Value="{DynamicResource ThemeGridRedText}" />

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+3
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,9 @@ private void GridRecent_PreviewMouseDoubleClick(object sender, MouseButtonEventA
16501650
// cancel if editing cell, because often try to double click to edit instead
16511651
if (IsEditingCell(gridRecent)) return;
16521652

1653+
// check if not clicked on the row
1654+
if (e.OriginalSource.GetType() != typeof(TextBlock)) return;
1655+
16531656
// cancel run if double clicked Arguments or Platform editable field
16541657
var currentColumnCell = gridRecent.CurrentCell.Column.DisplayIndex;
16551658
if (currentColumnCell == 4 || currentColumnCell == 6) return;

0 commit comments

Comments
 (0)