Skip to content

Commit e5bd166

Browse files
committed
ux: add icon to Add To Ignore panel
Signed-off-by: leo <longshuang@msn.cn>
1 parent f022ac2 commit e5bd166

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

src/Models/GitIgnoreFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class GitIgnoreFile
88
public static readonly List<GitIgnoreFile> Supported = [new(true), new(false)];
99

1010
public bool IsShared { get; set; }
11-
public string File => IsShared ? ".gitignore" : "$GIT_DIR/info/exclude";
11+
public string File => IsShared ? ".gitignore" : "<git_dir>/info/exclude";
1212
public string Desc => IsShared ? "Shared" : "Private";
1313

1414
public GitIgnoreFile(bool isShared)

src/Resources/Icons.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
<StreamGeometry x:Key="Icons.OrderByTime">M512 0a512 512 0 01512 512 57 57 0 01-114 0 398 398 0 10-398 398 57 57 0 010 114A512 512 0 01512 0zm367 600 121 120a57 57 0 01-80 81l-40-40V967a57 57 0 01-50 57l-7 0a57 57 0 01-57-57v-205l-40 40a57 57 0 01-75 5l-5-5a57 57 0 01-0-80l120-121a80 80 0 01113-0zM512 272a57 57 0 0157 57V499h114a57 57 0 0156 50L740 556a57 57 0 01-57 57H512a57 57 0 01-57-57v-228a57 57 0 0150-57L512 272z</StreamGeometry>
9494
<StreamGeometry x:Key="Icons.Password">M640 96c-158 0-288 130-288 288 0 17 3 31 5 46L105 681 96 691V928h224v-96h96v-96h96v-95c38 18 82 31 128 31 158 0 288-130 288-288s-130-288-288-288zm0 64c123 0 224 101 224 224s-101 224-224 224a235 235 0 01-109-28l-8-4H448v96h-96v96H256v96H160v-146l253-254 12-11-3-17C419 417 416 400 416 384c0-123 101-224 224-224zm64 96a64 64 0 100 128 64 64 0 100-128z</StreamGeometry>
9595
<StreamGeometry x:Key="Icons.Paste">M544 85c49 0 90 37 95 85h75a96 96 0 0196 89L811 267a32 32 0 01-28 32L779 299a32 32 0 01-32-28L747 267a32 32 0 00-28-32L715 235h-91a96 96 0 01-80 42H395c-33 0-62-17-80-42L224 235a32 32 0 00-32 28L192 267v576c0 16 12 30 28 32l4 0h128a32 32 0 0132 28l0 4a32 32 0 01-32 32h-128a96 96 0 01-96-89L128 843V267a96 96 0 0189-96L224 171h75a96 96 0 0195-85h150zm256 256a96 96 0 0196 89l0 7v405a96 96 0 01-89 96L800 939h-277a96 96 0 01-96-89L427 843v-405a96 96 0 0189-96L523 341h277zm-256-192H395a32 32 0 000 64h150a32 32 0 100-64z</StreamGeometry>
96+
<StreamGeometry x:Key="Icons.Pattern">M470 722q-23 3-43 3T384 722v-150l-106 106q-34-26-60-59L324 512H174q-3-23-3-43t3-42h150L218 320q16-20 28-32t32-27L384 367V217q23-4 43-4t43 4v150l106-106q34 26 60 59l-106 107h150q3 22 3 42T680 512h-150l106 107q-16 20-28 32t-32 27l-106-106v150zM0 811q0-36 25-61t61-25 61 25 25 61-25 61-61 25-61-25T0 811z</StreamGeometry>
9697
<StreamGeometry x:Key="Icons.Plus">m186 532 287 0 0 287c0 11 9 20 20 20s20-9 20-20l0-287 287 0c11 0 20-9 20-20s-9-20-20-20l-287 0 0-287c0-11-9-20-20-20s-20 9-20 20l0 287-287 0c-11 0-20 9-20 20s9 20 20 20z</StreamGeometry>
9798
<StreamGeometry x:Key="Icons.Pull">M432 0h160c27 0 48 21 48 48v336h175c36 0 53 43 28 68L539 757c-15 15-40 15-55 0L180 452c-25-25-7-68 28-68H384V48c0-27 21-48 48-48zm592 752v224c0 27-21 48-48 48H48c-27 0-48-21-48-48V752c0-27 21-48 48-48h293l98 98c40 40 105 40 145 0l98-98H976c27 0 48 21 48 48zm-248 176c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40zm128 0c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40z</StreamGeometry>
9899
<StreamGeometry x:Key="Icons.Push">M592 768h-160c-27 0-48-21-48-48V384h-175c-36 0-53-43-28-68L485 11c15-15 40-15 55 0l304 304c25 25 7 68-28 68H640v336c0 27-21 48-48 48zm432-16v224c0 27-21 48-48 48H48c-27 0-48-21-48-48V752c0-27 21-48 48-48h272v16c0 62 50 112 112 112h160c62 0 112-50 112-112v-16h272c27 0 48 21 48 48zm-248 176c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40zm128 0c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40z</StreamGeometry>

src/Views/AddToIgnore.axaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,35 @@
2121
Height="28"
2222
CornerRadius="3"
2323
Text="{Binding Pattern, Mode=TwoWay}"
24-
v:AutoFocusBehaviour.IsEnabled="True"/>
24+
v:AutoFocusBehaviour.IsEnabled="True">
25+
<TextBox.InnerLeftContent>
26+
<Path Width="12" Height="12" Margin="6,0,2,0" Data="{StaticResource Icons.Pattern}" Fill="{DynamicResource Brush.FG2}"/>
27+
</TextBox.InnerLeftContent>
28+
</TextBox>
2529

2630
<TextBlock Grid.Row="1" Grid.Column="0"
2731
HorizontalAlignment="Right" VerticalAlignment="Center"
2832
Margin="0,0,8,0"
2933
Text="{DynamicResource Text.AddToIgnore.Storage}"/>
3034
<ComboBox Grid.Row="1" Grid.Column="1"
31-
Height="28" Padding="8,0"
35+
Height="28" Padding="4,0"
3236
VerticalAlignment="Center" HorizontalAlignment="Stretch"
3337
ItemsSource="{Binding Source={x:Static m:GitIgnoreFile.Supported}}"
3438
SelectedItem="{Binding StorageFile, Mode=TwoWay}">
3539
<ComboBox.ItemTemplate>
3640
<DataTemplate DataType="m:GitIgnoreFile">
37-
<TextBlock VerticalAlignment="Center">
38-
<Run Text="{Binding File, Mode=OneWay}"/>
39-
<Run Text="" Foreground="{DynamicResource Brush.FG2}"/>
40-
<Run Text="{Binding Desc, Mode=OneWay}" Foreground="{DynamicResource Brush.FG2}"/>
41-
</TextBlock>
41+
<Grid ColumnDefinitions="20,*">
42+
<Path Grid.Column="0"
43+
Width="12" Height="12"
44+
Data="{StaticResource Icons.File}"
45+
Fill="{DynamicResource Brush.FG2}"/>
46+
47+
<TextBlock Grid.Column="1" VerticalAlignment="Center">
48+
<Run Text="{Binding File, Mode=OneWay}"/>
49+
<Run Text="" Foreground="{DynamicResource Brush.FG2}"/>
50+
<Run Text="{Binding Desc, Mode=OneWay}" Foreground="{DynamicResource Brush.FG2}"/>
51+
</TextBlock>
52+
</Grid>
4253
</DataTemplate>
4354
</ComboBox.ItemTemplate>
4455
</ComboBox>

0 commit comments

Comments
 (0)