Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Resources/Locales/en_US.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@
<x:String x:Key="Text.Preferences.Appearance.UseFixedTabWidth" xml:space="preserve">Use fixed tab width in titlebar</x:String>
<x:String x:Key="Text.Preferences.Appearance.UseNativeWindowFrame" xml:space="preserve">Use native window frame</x:String>
<x:String x:Key="Text.Preferences.DiffMerge" xml:space="preserve">DIFF/MERGE TOOL</x:String>
<x:String x:Key="Text.Preferences.DiffMerge.BindToDoubleClick" xml:space="preserve">Bind to double click</x:String>
<x:String x:Key="Text.Preferences.DiffMerge.DiffArgs" xml:space="preserve">Diff Arguments</x:String>
<x:String x:Key="Text.Preferences.DiffMerge.DiffArgs.Tip" xml:space="preserve">Available variables: $LOCAL, $REMOTE</x:String>
<x:String x:Key="Text.Preferences.DiffMerge.MergeArgs" xml:space="preserve">Merge Arguments</x:String>
Expand Down
7 changes: 7 additions & 0 deletions src/ViewModels/Preferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,12 @@ public string ShellOrTerminalArgs
}
}

public bool ExternalMergeToolBindToDoubleClick
{
get => _externalMergeToolBindToDoubleClick;
set => SetProperty(ref _externalMergeToolBindToDoubleClick, value);
}

public int ExternalMergeToolType
{
get => Native.OS.ExternalMergerType;
Expand Down Expand Up @@ -846,5 +852,6 @@ private bool RemoveInvalidRepositoriesRecursive(List<RepositoryNode> collection)

private string _gitDefaultCloneDir = string.Empty;
private int _shellOrTerminalType = -1;
private bool _externalMergeToolBindToDoubleClick = false;
}
}
1 change: 1 addition & 0 deletions src/Views/CommitChanges.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
EnableCompactFolders="{Binding Source={x:Static vm:Preferences.Instance}, Path=EnableCompactFoldersInChangesTree}"
Changes="{Binding VisibleChanges, Mode=OneWay}"
Selection="{Binding ChangeSelection, Mode=TwoWay}"
ChangeDoubleTapped="OnChangeDoubleTapped"
ContextRequested="OnChangeContextRequested"
KeyDown="OnChangeCollectionViewKeyDown"/>
</Border>
Expand Down
12 changes: 12 additions & 0 deletions src/Views/CommitChanges.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Platform.Storage;
using Avalonia.VisualTree;

Expand All @@ -16,6 +17,17 @@ public CommitChanges()
InitializeComponent();
}

private void OnChangeDoubleTapped(object sender, RoutedEventArgs e)
{
if (ViewModels.Preferences.Instance.ExternalMergeToolBindToDoubleClick &&
DataContext is ViewModels.CommitDetail vm &&
sender is ChangeCollectionView { Selection: { Count: 1, HasFolder: false } selection })
{
vm.OpenChangeInMergeTool(selection.Changes[0]);
e.Handled = true;
}
}

private void OnChangeContextRequested(object sender, ContextRequestedEventArgs e)
{
e.Handled = true;
Expand Down
6 changes: 5 additions & 1 deletion src/Views/Preferences.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
<TextBlock Classes="bold" Margin="4,0,0,0" Text="{DynamicResource Text.Preferences.DiffMerge}"/>
</StackPanel>
<Rectangle Margin="0,8" Fill="{DynamicResource Brush.Border2}" Height=".6" HorizontalAlignment="Stretch"/>
<Grid Margin="8,0,0,8" RowDefinitions="32,Auto,Auto,Auto">
<Grid Margin="8,0,0,8" RowDefinitions="32,Auto,Auto,Auto,Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="IntegrationLabel"/>
<ColumnDefinition Width="*"/>
Expand Down Expand Up @@ -672,6 +672,10 @@
</Border>
</TextBox.InnerRightContent>
</TextBox>

<CheckBox Grid.Row="4" Grid.Column="1"
Content="{DynamicResource Text.Preferences.DiffMerge.BindToDoubleClick}"
IsChecked="{Binding ExternalMergeToolBindToDoubleClick, Mode=TwoWay}"/>
</Grid>
</StackPanel>
</TabItem>
Expand Down