feat(ui): add reusable inherited-source badge control
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
13
src/ClaudeDo.Ui/Views/Controls/InheritedBadge.axaml
Normal file
13
src/ClaudeDo.Ui/Views/Controls/InheritedBadge.axaml
Normal 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>
|
||||
18
src/ClaudeDo.Ui/Views/Controls/InheritedBadge.axaml.cs
Normal file
18
src/ClaudeDo.Ui/Views/Controls/InheritedBadge.axaml.cs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user