mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-29 16:14:59 +00:00
ux: icons
This commit is contained in:
parent
a597845bb4
commit
684fedb9bd
18 changed files with 52 additions and 52 deletions
|
@ -51,25 +51,25 @@ namespace SourceGit.Views
|
|||
|
||||
if (node.Backend is Models.Remote)
|
||||
{
|
||||
CreateContent(12, new Thickness(0, 2, 0, 0), "Icons.Remote");
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Remote");
|
||||
}
|
||||
else if (node.Backend is Models.Branch branch)
|
||||
{
|
||||
if (branch.IsCurrent)
|
||||
CreateContent(12, new Thickness(0, 2, 0, 0), "Icons.Check");
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Check");
|
||||
else
|
||||
CreateContent(12, new Thickness(2, 0, 0, 0), "Icons.Branch");
|
||||
CreateContent(new Thickness(2, 0, 0, 0), "Icons.Branch");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node.IsExpanded)
|
||||
CreateContent(10, new Thickness(0, 2, 0, 0), "Icons.Folder.Open");
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder.Open");
|
||||
else
|
||||
CreateContent(10, new Thickness(0, 2, 0, 0), "Icons.Folder.Fill");
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder");
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateContent(double size, Thickness margin, string iconKey)
|
||||
private void CreateContent(Thickness margin, string iconKey)
|
||||
{
|
||||
var geo = this.FindResource(iconKey) as StreamGeometry;
|
||||
if (geo == null)
|
||||
|
@ -77,8 +77,8 @@ namespace SourceGit.Views
|
|||
|
||||
Content = new Path()
|
||||
{
|
||||
Width = size,
|
||||
Height = size,
|
||||
Width = 12,
|
||||
Height = 12,
|
||||
HorizontalAlignment = HorizontalAlignment.Left,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
Margin = margin,
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
Classes="folder"
|
||||
Focusable="False"
|
||||
Width="14" Height="14"
|
||||
Margin="0,1,0,0"
|
||||
Foreground="Goldenrod"
|
||||
IsChecked="{Binding IsExpanded}"
|
||||
IsVisible="{Binding IsFolder}"/>
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<Path Width="12" Height="12" Margin="0,0,8,0"
|
||||
Fill="{Binding Node.Bookmark, Converter={x:Static c:BookmarkConverters.ToBrush}}"
|
||||
StrokeThickness="{Binding Node.Bookmark, Converter={x:Static c:BookmarkConverters.ToStrokeThickness}}"
|
||||
Stroke="{DynamicResource Brush.FG1}"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||
Data="{StaticResource Icons.Bookmark}"
|
||||
IsVisible="{Binding Node.IsRepository}"/>
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
<Border Height="20" VerticalAlignment="Center">
|
||||
<Path Width="12" Height="12"
|
||||
Fill="{Binding Converter={x:Static c:BookmarkConverters.ToBrush}}"
|
||||
StrokeThickness="{Binding Converter={x:Static c:BookmarkConverters.ToStrokeThickness}}"
|
||||
Stroke="{DynamicResource Brush.FG1}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Data="{StaticResource Icons.Bookmark}"/>
|
||||
</Border>
|
||||
|
|
|
@ -46,8 +46,6 @@
|
|||
<Path Grid.Column="0"
|
||||
Width="12" Height="12" Margin="12,0"
|
||||
Fill="{Binding Node.Bookmark, Converter={x:Static c:BookmarkConverters.ToBrush}}"
|
||||
StrokeThickness="{Binding Node.Bookmark, Converter={x:Static c:BookmarkConverters.ToStrokeThickness}}"
|
||||
Stroke="{DynamicResource Brush.FG1}"
|
||||
Data="{StaticResource Icons.Bookmark}"
|
||||
IsVisible="{Binding Node.IsRepository}"
|
||||
IsHitTestVisible="False"/>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<Grid ColumnDefinitions="*,Auto,*">
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="4,0,0,0">
|
||||
<Button Classes="icon_button" Width="32" Command="{Binding OpenInFileManager}" ToolTip.Tip="{DynamicResource Text.Repository.Explore}">
|
||||
<Path Width="15" Height="13" Data="{StaticResource Icons.Folder.Open}" Margin="0,1,0,0"/>
|
||||
<Path Width="15" Height="15" Data="{StaticResource Icons.Explore}" Margin="0,2,0,0"/>
|
||||
</Button>
|
||||
|
||||
<Button Classes="icon_button" Width="32" Command="{Binding OpenInTerminal}" ToolTip.Tip="{DynamicResource Text.Repository.Terminal}">
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace SourceGit.Views
|
|||
CreateContent("Icons.Submodule", new Thickness(0, 0, 0, 0));
|
||||
break;
|
||||
default:
|
||||
CreateContent(node.IsExpanded ? "Icons.Folder.Open" : "Icons.Folder.Fill", new Thickness(0, 2, 0, 0), Brushes.Goldenrod);
|
||||
CreateContent(node.IsExpanded ? "Icons.Folder.Open" : "Icons.Folder", new Thickness(0, 2, 0, 0), Brushes.Goldenrod);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ namespace SourceGit.Views
|
|||
Width = 14,
|
||||
Height = 14,
|
||||
Margin = margin,
|
||||
Stretch = Stretch.Uniform,
|
||||
HorizontalAlignment = HorizontalAlignment.Left,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
Data = geo,
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
VerticalContentAlignment="Center"
|
||||
Text="{Binding SearchFilter, Mode=TwoWay}">
|
||||
<TextBox.InnerLeftContent>
|
||||
<Path Width="16" Height="16" Margin="6,0,3,0" Data="{StaticResource Icons.Search}" Fill="{DynamicResource Brush.FG1}"/>
|
||||
<Path Width="16" Height="16" Margin="6,0,3,0" Data="{StaticResource Icons.Search}" Fill="{DynamicResource Brush.FG2}"/>
|
||||
</TextBox.InnerLeftContent>
|
||||
|
||||
<TextBox.InnerRightContent>
|
||||
|
@ -59,7 +59,7 @@
|
|||
<TreeView.ItemTemplate>
|
||||
<TreeDataTemplate ItemsSource="{Binding SubNodes}">
|
||||
<Grid Height="30"
|
||||
ColumnDefinitions="Auto,Auto,*"
|
||||
ColumnDefinitions="18,Auto,*"
|
||||
Background="Transparent"
|
||||
Loaded="SetupTreeNodeDragAndDrop"
|
||||
ContextRequested="OnTreeNodeContextRequested"
|
||||
|
@ -68,19 +68,18 @@
|
|||
PointerReleased="OnPointerReleasedOnTreeNode"
|
||||
DoubleTapped="OnDoubleTappedTreeNode"
|
||||
ClipToBounds="True">
|
||||
<Path Grid.Column="0" Width="12" Height="12" Margin="0,0,4,0"
|
||||
<Path Grid.Column="0"
|
||||
Width="14" Height="14"
|
||||
Fill="{Binding Bookmark, Converter={x:Static c:BookmarkConverters.ToBrush}}"
|
||||
StrokeThickness="{Binding Bookmark, Converter={x:Static c:BookmarkConverters.ToStrokeThickness}}"
|
||||
Stroke="{DynamicResource Brush.FG1}"
|
||||
HorizontalAlignment="Left"
|
||||
HorizontalAlignment="Center"
|
||||
Data="{StaticResource Icons.Bookmark}"
|
||||
IsVisible="{Binding IsRepository}"/>
|
||||
|
||||
<ToggleButton Grid.Column="0"
|
||||
Classes="folder"
|
||||
Focusable="False"
|
||||
Width="12" Height="12"
|
||||
Margin="0,0,4,0"
|
||||
Width="14" Height="14"
|
||||
HorizontalAlignment="Left"
|
||||
Foreground="{DynamicResource Brush.FG1}"
|
||||
IsChecked="{Binding IsExpanded}"
|
||||
IsVisible="{Binding !IsRepository}"/>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</Button>
|
||||
|
||||
<Button Classes="icon_button" Width="32" Click="OpenLocalRepository" ToolTip.Tip="{DynamicResource Text.Welcome.OpenOrInit}">
|
||||
<Path Width="16" Height="16" Data="{StaticResource Icons.Folder.Add2}" Margin="0,4,0,0"/>
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Folder.Open}" Margin="0,2,0,0"/>
|
||||
</Button>
|
||||
|
||||
<Button Classes="icon_button" Width="32" Command="{Binding OpenTerminal}" ToolTip.Tip="{DynamicResource Text.Welcome.OpenTerminal}">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue