ux: use bold font weight for current branch name (#997)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-02-18 16:54:00 +08:00
parent af4645a4ad
commit 3d4a9b86b4
No known key found for this signature in database
2 changed files with 5 additions and 0 deletions

View file

@ -1,4 +1,5 @@
using Avalonia.Data.Converters; using Avalonia.Data.Converters;
using Avalonia.Media;
namespace SourceGit.Converters namespace SourceGit.Converters
{ {
@ -6,5 +7,8 @@ namespace SourceGit.Converters
{ {
public static readonly FuncValueConverter<bool, double> ToPageTabWidth = public static readonly FuncValueConverter<bool, double> ToPageTabWidth =
new FuncValueConverter<bool, double>(x => x ? 200 : double.NaN); new FuncValueConverter<bool, double>(x => x ? 200 : double.NaN);
public static readonly FuncValueConverter<bool, FontWeight> IsBoldToFontWeight =
new FuncValueConverter<bool, FontWeight>(x => x ? FontWeight.Bold : FontWeight.Normal);
} }
} }

View file

@ -65,6 +65,7 @@
<TextBlock Grid.Column="1" <TextBlock Grid.Column="1"
Classes="primary" Classes="primary"
Text="{Binding Name}" Text="{Binding Name}"
FontWeight="{Binding IsCurrent, Converter={x:Static c:BoolConverters.IsBoldToFontWeight}}"
TextTrimming="CharacterEllipsis"/> TextTrimming="CharacterEllipsis"/>
</Grid> </Grid>