From 9c6798ef1b39bcaa0e6c88bbcdd402df94f8d91e Mon Sep 17 00:00:00 2001 From: Gadfly Date: Tue, 30 Apr 2024 21:50:30 +0800 Subject: [PATCH] fix: Fixed the issue when the email address is too long and exceeds the scope of the StackPanel --- src/Converters/BoolConverters.cs | 6 +++- src/Views/CommitBaseInfo.axaml | 54 ++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/Converters/BoolConverters.cs b/src/Converters/BoolConverters.cs index 7ddb4637..02b9df8b 100644 --- a/src/Converters/BoolConverters.cs +++ b/src/Converters/BoolConverters.cs @@ -1,4 +1,5 @@ -using Avalonia.Data.Converters; +using Avalonia.Controls; +using Avalonia.Data.Converters; using Avalonia.Media; namespace SourceGit.Converters @@ -10,5 +11,8 @@ namespace SourceGit.Converters public static readonly FuncValueConverter BoldIfTrue = new FuncValueConverter(x => x ? FontWeight.Bold : FontWeight.Regular); + + public static readonly FuncValueConverter BoolToStarOrAutoGridLength = + new(value => value ? new GridLength(1, GridUnitType.Star) : new GridLength(1, GridUnitType.Auto)); } } diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index 4b257516..37375319 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -12,34 +12,42 @@ - + + + + + - - - - - - + + + + + + + + + - - + - - - - - - + + + + + + + + + - - +