mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
ux: re-design merge option style
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
10fd0f9d15
commit
ddfc868df3
3 changed files with 28 additions and 11 deletions
|
@ -6,7 +6,7 @@
|
|||
[
|
||||
new MergeMode("Default", "Fast-forward if possible", ""),
|
||||
new MergeMode("No Fast-forward", "Always create a merge commit", "--no-ff"),
|
||||
new MergeMode("Squash", "Use '--squash'", "--squash"),
|
||||
new MergeMode("Squash", "Squash merge", "--squash"),
|
||||
new MergeMode("Don't commit", "Merge without commit", "--no-ff --no-commit"),
|
||||
];
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace SourceGit.ViewModels
|
|||
get;
|
||||
}
|
||||
|
||||
public Models.MergeMode SelectedMode
|
||||
public Models.MergeMode Mode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
@ -28,7 +28,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
Source = source;
|
||||
Into = into;
|
||||
SelectedMode = AutoSelectMergeMode();
|
||||
Mode = AutoSelectMergeMode();
|
||||
View = new Views.Merge() { DataContext = this };
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
Source = source;
|
||||
Into = into;
|
||||
SelectedMode = AutoSelectMergeMode();
|
||||
Mode = AutoSelectMergeMode();
|
||||
View = new Views.Merge() { DataContext = this };
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
Source = source;
|
||||
Into = into;
|
||||
SelectedMode = AutoSelectMergeMode();
|
||||
Mode = AutoSelectMergeMode();
|
||||
View = new Views.Merge() { DataContext = this };
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
new Commands.Merge(_repo.FullPath, _sourceName, SelectedMode.Arg, SetProgressDescription).Exec();
|
||||
new Commands.Merge(_repo.FullPath, _sourceName, Mode.Arg, SetProgressDescription).Exec();
|
||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||
return true;
|
||||
});
|
||||
|
|
|
@ -60,15 +60,32 @@
|
|||
Height="28" Padding="8,0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
ItemsSource="{Binding Source={x:Static m:MergeMode.Supported}}"
|
||||
SelectedItem="{Binding SelectedMode, Mode=TwoWay}">
|
||||
SelectedItem="{Binding Mode, Mode=TwoWay}"
|
||||
Grid.IsSharedSizeScope="True">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="m:MergeMode">
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
</StackPanel>
|
||||
<Grid Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="MergeModeNameColumn"/>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="MergeModeDescriptionColumn"/>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="MergeModeOptionColumn"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Text="{Binding Name}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding Desc}" Margin="8,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
<TextBlock Grid.Column="2" Text="{Binding Arg}" HorizontalAlignment="Right" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
|
||||
<ComboBox.SelectionBoxItemTemplate>
|
||||
<DataTemplate DataType="m:MergeMode">
|
||||
<Grid ColumnDefinitions="Auto,*">
|
||||
<TextBlock Grid.Column="0" Text="{Binding Name}" Margin="0,0,8,0"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding Desc}" HorizontalAlignment="Right" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ComboBox.SelectionBoxItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue