refactor: stash (#1420) (#1426)

- supports to use multi-line as stash message
- new style to display stashes

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-18 12:32:13 +08:00
parent b06a4cbb8a
commit 6d682ac409
No known key found for this signature in database
19 changed files with 219 additions and 54 deletions

View file

@ -12,23 +12,12 @@
<TextBlock FontSize="18"
Classes="bold"
Text="{DynamicResource Text.Stash.Title}"/>
<Grid Margin="8,16,0,0" RowDefinitions="32,32,Auto,Auto,Auto" ColumnDefinitions="120,*">
<Grid Margin="8,20,0,0" RowDefinitions="32,Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="100,356">
<TextBlock Grid.Row="0" Grid.Column="0"
HorizontalAlignment="Right"
Margin="8,0"
Text="{DynamicResource Text.Stash.Message}"/>
<TextBox Grid.Row="0" Grid.Column="1"
Height="26"
CornerRadius="3"
Text="{Binding Message, Mode=TwoWay}"
Watermark="{DynamicResource Text.Stash.Message.Placeholder}"
v:AutoFocusBehaviour.IsEnabled="True"/>
<TextBlock Grid.Row="1" Grid.Column="0"
HorizontalAlignment="Right"
Margin="8,0"
Text="{DynamicResource Text.Stash.Changes}"/>
<ComboBox Grid.Row="1" Grid.Column="1"
Text="{DynamicResource Text.Stash.Mode}"/>
<ComboBox Grid.Row="0" Grid.Column="1"
MinHeight="28"
Padding="8,0"
ItemsSource="{Binding Source={x:Static m:DealWithChangesAfterStashing.Supported}}"
@ -48,15 +37,38 @@
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="1" Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,8,8,0"
Text="{DynamicResource Text.Stash.Message}"/>
<TextBox Grid.Row="1" Grid.Column="1"
Height="100"
Margin="0,4,0,0"
CornerRadius="3"
Text="{Binding Message, Mode=TwoWay}"
Watermark="{DynamicResource Text.Stash.Message.Placeholder}"
AcceptsReturn="True"
AcceptsTab="True"
VerticalContentAlignment="Top"
Padding="4"
v:AutoFocusBehaviour.IsEnabled="True"/>
<CheckBox Grid.Row="2" Grid.Column="1"
<TextBlock Grid.Row="2" Grid.Column="1"
Classes="small"
Margin="0,2,4,4"
Text="{DynamicResource Text.PopupEnterKeyTip}"
TextWrapping="Wrap"
Foreground="{DynamicResource Brush.FG2}"/>
<CheckBox Grid.Row="3" Grid.Column="1"
Height="32"
Content="{DynamicResource Text.Stash.OnlyStagedChanges}"
IsChecked="{Binding OnlyStaged, Mode=TwoWay}"
IsVisible="{Binding !HasSelectedFiles}"
ToolTip.Tip="--staged"/>
<CheckBox Grid.Row="3" Grid.Column="1"
<CheckBox Grid.Row="4" Grid.Column="1"
Height="32"
Content="{DynamicResource Text.Stash.IncludeUntracked}"
IsChecked="{Binding IncludeUntracked, Mode=TwoWay}"
@ -69,7 +81,7 @@
</CheckBox.IsVisible>
</CheckBox>
<TextBlock Grid.Row="4" Grid.Column="1"
<TextBlock Grid.Row="5" Grid.Column="1"
Margin="0,4,0,0"
Text="{DynamicResource Text.Stash.TipForSelectedFiles}"
TextWrapping="Wrap"