mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-27 05:15:05 +00:00
ux: re-design Add File(s) To Ignore
popup
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
71dd58a5d6
commit
a8803ca188
2 changed files with 8 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
|
@ -10,6 +11,7 @@ namespace SourceGit.Models
|
|||
public bool IsShared { get; set; }
|
||||
public string File => IsShared ? ".gitignore" : "<git_dir>/info/exclude";
|
||||
public string Desc => IsShared ? "Shared" : "Private";
|
||||
public IBrush Brush => IsShared ? Brushes.Green : Brushes.Gray;
|
||||
|
||||
public GitIgnoreFile(bool isShared)
|
||||
{
|
||||
|
|
|
@ -38,17 +38,17 @@
|
|||
SelectedItem="{Binding StorageFile, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="m:GitIgnoreFile">
|
||||
<Grid ColumnDefinitions="20,*">
|
||||
<Grid ColumnDefinitions="20,*,Auto">
|
||||
<Path Grid.Column="0"
|
||||
Width="12" Height="12"
|
||||
Data="{StaticResource Icons.File}"
|
||||
Fill="{DynamicResource Brush.FG2}"/>
|
||||
|
||||
<TextBlock Grid.Column="1" VerticalAlignment="Center">
|
||||
<Run Text="{Binding File, Mode=OneWay}"/>
|
||||
<Run Text="•" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
<Run Text="{Binding Desc, Mode=OneWay}" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
</TextBlock>
|
||||
<TextBlock Grid.Column="1" Text="{Binding File, Mode=OneWay}" VerticalAlignment="Center"/>
|
||||
|
||||
<Border Grid.Column="2" Height="16" Background="{Binding Brush}" CornerRadius="8" VerticalAlignment="Center">
|
||||
<TextBlock Classes="primary" Text="{Binding Desc}" Margin="8,0" FontSize="10" Foreground="White"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue