Skip to content

Commit 04913f5

Browse files
committed
enhance: use Tapped event instead of DoubleTapped to select item in suggestion popup via mouse
1 parent e761ff9 commit 04913f5

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎src/Views/Repository.axaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,11 +573,11 @@
573573

574574
<ListBox.ItemTemplate>
575575
<DataTemplate>
576-
<Border Padding="8,4" Height="42" Background="Transparent">
576+
<Border Padding="8,4" Height="42" Background="Transparent" Tapped="OnSearchSuggestionTapped">
577577
<ContentControl Content="{Binding}" IsHitTestVisible="False">
578578
<ContentControl.DataTemplates>
579579
<DataTemplate DataType="x:String">
580-
<Grid Background="Transparent" ColumnDefinitions="Auto,*" DoubleTapped="OnSearchSuggestionDoubleTapped">
580+
<Grid ColumnDefinitions="Auto,*">
581581
<Path Width="24" Height="24" Data="{StaticResource Icons.File}"/>
582582
<StackPanel Grid.Column="1" Margin="6,0,0,0" Orientation="Vertical" VerticalAlignment="Center">
583583
<TextBlock Text="{Binding Converter={x:Static c:PathConverters.PureFileName}}"/>
@@ -587,7 +587,7 @@
587587
</DataTemplate>
588588

589589
<DataTemplate DataType="m:User">
590-
<Grid Background="Transparent" ColumnDefinitions="Auto,*" DoubleTapped="OnSearchSuggestionDoubleTapped">
590+
<Grid ColumnDefinitions="Auto,*">
591591
<v:Avatar Grid.Column="0" Width="24" Height="24" VerticalAlignment="Center" User="{Binding}"/>
592592
<StackPanel Grid.Column="1" Margin="6,0,0,0" Orientation="Vertical" VerticalAlignment="Center">
593593
<TextBlock Text="{Binding Name, Mode=OneWay}"/>

‎src/Views/Repository.axaml.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ private void OnSearchSuggestionBoxKeyDown(object _, KeyEventArgs e)
337337
}
338338
}
339339

340-
private void OnSearchSuggestionDoubleTapped(object sender, TappedEventArgs e)
340+
private void OnSearchSuggestionTapped(object sender, TappedEventArgs e)
341341
{
342342
if (DataContext is not ViewModels.Repository repo)
343343
return;

‎src/Views/RevisionFiles.axaml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,16 @@
8888

8989
<ListBox.ItemTemplate>
9090
<DataTemplate DataType="x:String">
91-
<StackPanel Background="Transparent" Orientation="Vertical" Margin="8,4" DoubleTapped="OnSearchSuggestionDoubleTapped">
92-
<StackPanel Orientation="Horizontal">
91+
<StackPanel Background="Transparent" Orientation="Vertical" Margin="8,4" Tapped="OnSearchSuggestionTapped">
92+
<StackPanel Orientation="Horizontal" IsHitTestVisible="False">
9393
<Path Width="12" Height="12" Data="{StaticResource Icons.File}"/>
9494
<TextBlock Margin="6,0,0,0" Text="{Binding Converter={x:Static c:PathConverters.PureFileName}}"/>
9595
</StackPanel>
96-
<TextBlock FontSize="12" Margin="18,2,0,0" Foreground="{DynamicResource Brush.FG2}" Text="{Binding Converter={x:Static c:PathConverters.PureDirectoryName}}"/>
96+
<TextBlock FontSize="12"
97+
Margin="18,2,0,0"
98+
Foreground="{DynamicResource Brush.FG2}"
99+
Text="{Binding Converter={x:Static c:PathConverters.PureDirectoryName}}"
100+
IsHitTestVisible="False"/>
97101
</StackPanel>
98102
</DataTemplate>
99103
</ListBox.ItemTemplate>

‎src/Views/RevisionFiles.axaml.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private async void OnSearchSuggestionBoxKeyDown(object _, KeyEventArgs e)
6969
}
7070
}
7171

72-
private async void OnSearchSuggestionDoubleTapped(object sender, TappedEventArgs e)
72+
private async void OnSearchSuggestionTapped(object sender, TappedEventArgs e)
7373
{
7474
if (DataContext is not ViewModels.CommitDetail vm)
7575
return;

0 commit comments

Comments
 (0)