feat(ui): add reusable inherited-source badge control

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-06-04 12:29:15 +02:00
parent 92cee125cc
commit 3e3041c1c7
2 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ClaudeDo.Ui.Views.Controls.InheritedBadge"
x:Name="Root">
<Border Background="{DynamicResource Surface3Brush}"
CornerRadius="4" Padding="6,1"
IsVisible="{Binding #Root.BadgeText, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock FontSize="11"
Foreground="{DynamicResource TextMuteBrush}"
Text="{Binding #Root.BadgeText}"/>
</Border>
</UserControl>

View File

@@ -0,0 +1,18 @@
using Avalonia;
using Avalonia.Controls;
namespace ClaudeDo.Ui.Views.Controls;
public partial class InheritedBadge : UserControl
{
public static readonly StyledProperty<string?> BadgeTextProperty =
AvaloniaProperty.Register<InheritedBadge, string?>(nameof(BadgeText));
public string? BadgeText
{
get => GetValue(BadgeTextProperty);
set => SetValue(BadgeTextProperty, value);
}
public InheritedBadge() => InitializeComponent();
}