|
3 | 3 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
4 | 4 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 | 5 | xmlns:c="using:SourceGit.Converters" |
| 6 | + xmlns:m="using:SourceGit.Models" |
6 | 7 | xmlns:vm="using:SourceGit.ViewModels" |
7 | 8 | xmlns:v="using:SourceGit.Views" |
8 | 9 | mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
|
106 | 107 | <DataTemplate DataType="vm:RepositoryNode"> |
107 | 108 | <Grid Background="Transparent" |
108 | 109 | Height="30" |
109 | | - ColumnDefinitions="16,18,Auto,*" |
| 110 | + ColumnDefinitions="16,18,*,Auto,16" |
110 | 111 | Margin="{Binding Depth, Converter={x:Static c:IntConverters.ToTreeMargin}}" |
111 | 112 | ClipToBounds="True" |
112 | 113 | ContextRequested="OnTreeNodeContextRequested" |
|
142 | 143 |
|
143 | 144 | <StackPanel Grid.Column="2" Orientation="Horizontal"> |
144 | 145 | <TextBlock VerticalAlignment="Center" Text="{Binding Name}"/> |
| 146 | + <TextBlock Margin="4,0,0,0" VerticalAlignment="Center" Foreground="{DynamicResource Brush.FG2}" Text="{Binding Id, StringFormat=({0})}"> |
| 147 | + <TextBlock.IsVisible> |
| 148 | + <MultiBinding Converter="{x:Static BoolConverters.And}"> |
| 149 | + <Binding Path="IsRepository"/> |
| 150 | + <Binding Path="IsInvalid" Converter="{x:Static BoolConverters.Not}"/> |
| 151 | + </MultiBinding> |
| 152 | + </TextBlock.IsVisible> |
| 153 | + </TextBlock> |
145 | 154 | <Path Margin="2,0,0,0" |
146 | 155 | Width="12" Height="12" |
147 | 156 | Data="{StaticResource Icons.Error}" |
148 | 157 | Fill="Orange" |
149 | 158 | IsVisible="{Binding IsInvalid}"/> |
150 | 159 | </StackPanel> |
151 | 160 |
|
152 | | - <Border Grid.Column="3" Margin="8,0" VerticalAlignment="Center" ClipToBounds="True"> |
153 | | - <TextBlock HorizontalAlignment="Right" |
154 | | - Foreground="{DynamicResource Brush.FG2}" |
155 | | - Text="{Binding Id, Converter={x:Static c:PathConverters.RelativeToHome}}" |
156 | | - IsVisible="{Binding IsRepository}"/> |
157 | | - </Border> |
| 161 | + <StackPanel Grid.Column="3" Orientation="Horizontal" IsVisible="{Binding IsRepository}"> |
| 162 | + <Border Margin="3,0,0,0" |
| 163 | + Height="18" |
| 164 | + CornerRadius="9" |
| 165 | + Padding="6,0" |
| 166 | + Background="{DynamicResource Brush.FG1}" |
| 167 | + VerticalAlignment="Center" |
| 168 | + IsVisible="{Binding LocalChanges, Converter={x:Static c:IntConverters.IsGreaterThanZero}}"> |
| 169 | + <TextBlock Text="{Binding LocalChanges}" |
| 170 | + FontFamily="{DynamicResource Fonts.Monospace}" |
| 171 | + FontSize="11" |
| 172 | + Foreground="{DynamicResource Brush.Window}"/> |
| 173 | + </Border> |
| 174 | + |
| 175 | + <ContentControl Margin="3,0,0,0" |
| 176 | + Content="{Binding CurrentBranch}" |
| 177 | + IsVisible="{Binding CurrentBranch, Converter={x:Static ObjectConverters.IsNotNull}}"> |
| 178 | + <ContentControl.DataTemplates> |
| 179 | + <DataTemplate DataType="m:Branch"> |
| 180 | + <StackPanel Orientation="Horizontal"> |
| 181 | + <TextBlock Margin="3,0" |
| 182 | + Text="{Binding TrackStatusDescription}" |
| 183 | + FontFamily="{DynamicResource Fonts.Monospace}" |
| 184 | + FontSize="12" |
| 185 | + IsVisible="{Binding IsTrackStatusVisible}"/> |
| 186 | + |
| 187 | + <Border Margin="3,0,0,0" |
| 188 | + BorderThickness="1" |
| 189 | + BorderBrush="{DynamicResource Brush.FG2}" |
| 190 | + Height="20" |
| 191 | + CornerRadius="4" |
| 192 | + Padding="4,0"> |
| 193 | + <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> |
| 194 | + <Path Width="12" Height="12" Data="{StaticResource Icons.Branch}"/> |
| 195 | + <TextBlock Margin="2,0,0,0" Text="{Binding Name}" FontSize="12"/> |
| 196 | + </StackPanel> |
| 197 | + </Border> |
| 198 | + </StackPanel> |
| 199 | + </DataTemplate> |
| 200 | + </ContentControl.DataTemplates> |
| 201 | + </ContentControl> |
| 202 | + </StackPanel> |
158 | 203 | </Grid> |
159 | 204 | </DataTemplate> |
160 | 205 | </ListBox.ItemTemplate> |
|
0 commit comments