Skip to content

Commit 14f47a9

Browse files
committed
ux: style for current branch in branch tree (#991
Signed-off-by: leo <[email protected]>
1 parent 7ae5100 commit 14f47a9

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/ViewModels/BranchTreeNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public bool IsBranch
4040
get => Backend is Models.Branch;
4141
}
4242

43-
public FontWeight NameFontWeight
43+
public bool IsCurrent
4444
{
45-
get => Backend is Models.Branch { IsCurrent: true } ? FontWeight.Bold : FontWeight.Regular;
45+
get => Backend is Models.Branch { IsCurrent: true };
4646
}
4747

4848
public string Tooltip

src/Views/BranchTree.axaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,17 @@
5757
IsExpanded="{Binding IsExpanded}"/>
5858

5959
<!-- Name -->
60-
<TextBlock Grid.Column="1"
61-
Text="{Binding Name}"
62-
Classes="primary"
63-
FontWeight="{Binding NameFontWeight}"
64-
TextTrimming="CharacterEllipsis"/>
60+
<Grid Grid.Column="1" ColumnDefinitions="Auto,*">
61+
<Border Grid.Column="0" Margin="0,0,4,0" Background="Green" Height="16" CornerRadius="8" VerticalAlignment="Center" IsVisible="{Binding IsCurrent}">
62+
<TextBlock Text="HEAD" Classes="primary" Margin="8,0" Foreground="#FFDDDDDD" FontSize="10" VerticalAlignment="Center"/>
63+
</Border>
64+
65+
<TextBlock Grid.Column="1"
66+
Classes="primary"
67+
Text="{Binding Name}"
68+
TextTrimming="CharacterEllipsis"/>
69+
</Grid>
70+
6571

6672
<!-- Tracking status -->
6773
<v:BranchTreeNodeTrackStatusPresenter Grid.Column="2"

0 commit comments

Comments
 (0)