mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-27 21:35:00 +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.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Avalonia.Media;
|
||||||
|
|
||||||
namespace SourceGit.Models
|
namespace SourceGit.Models
|
||||||
{
|
{
|
||||||
|
@ -10,6 +11,7 @@ namespace SourceGit.Models
|
||||||
public bool IsShared { get; set; }
|
public bool IsShared { get; set; }
|
||||||
public string File => IsShared ? ".gitignore" : "<git_dir>/info/exclude";
|
public string File => IsShared ? ".gitignore" : "<git_dir>/info/exclude";
|
||||||
public string Desc => IsShared ? "Shared" : "Private";
|
public string Desc => IsShared ? "Shared" : "Private";
|
||||||
|
public IBrush Brush => IsShared ? Brushes.Green : Brushes.Gray;
|
||||||
|
|
||||||
public GitIgnoreFile(bool isShared)
|
public GitIgnoreFile(bool isShared)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,17 +38,17 @@
|
||||||
SelectedItem="{Binding StorageFile, Mode=TwoWay}">
|
SelectedItem="{Binding StorageFile, Mode=TwoWay}">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate DataType="m:GitIgnoreFile">
|
<DataTemplate DataType="m:GitIgnoreFile">
|
||||||
<Grid ColumnDefinitions="20,*">
|
<Grid ColumnDefinitions="20,*,Auto">
|
||||||
<Path Grid.Column="0"
|
<Path Grid.Column="0"
|
||||||
Width="12" Height="12"
|
Width="12" Height="12"
|
||||||
Data="{StaticResource Icons.File}"
|
Data="{StaticResource Icons.File}"
|
||||||
Fill="{DynamicResource Brush.FG2}"/>
|
Fill="{DynamicResource Brush.FG2}"/>
|
||||||
|
|
||||||
<TextBlock Grid.Column="1" VerticalAlignment="Center">
|
<TextBlock Grid.Column="1" Text="{Binding File, Mode=OneWay}" VerticalAlignment="Center"/>
|
||||||
<Run Text="{Binding File, Mode=OneWay}"/>
|
|
||||||
<Run Text="•" Foreground="{DynamicResource Brush.FG2}"/>
|
<Border Grid.Column="2" Height="16" Background="{Binding Brush}" CornerRadius="8" VerticalAlignment="Center">
|
||||||
<Run Text="{Binding Desc, Mode=OneWay}" Foreground="{DynamicResource Brush.FG2}"/>
|
<TextBlock Classes="primary" Text="{Binding Desc}" Margin="8,0" FontSize="10" Foreground="White"/>
|
||||||
</TextBlock>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue