Flow.Launcher/Flow.Launcher.Avalonia/Views/Controls/HotkeyControl.axaml

37 lines
1.7 KiB
Text
Raw Permalink Normal View History

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="50"
x:Class="Flow.Launcher.Avalonia.Views.Controls.HotkeyControl"
x:Name="root">
<Button Command="{Binding #root.RecordHotkeyCommand}"
Padding="8,4"
Background="{DynamicResource ControlFillColorDefaultBrush}"
BorderBrush="{DynamicResource ControlElevationBorderBrush}"
BorderThickness="1"
CornerRadius="4"
HorizontalAlignment="Left">
<ItemsControl ItemsSource="{Binding #root.KeysToDisplay}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="4" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Padding="6,2"
Background="{DynamicResource AccentFillColorDefaultBrush}"
CornerRadius="4">
<TextBlock Text="{Binding}"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
FontSize="12"
FontWeight="SemiBold" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Button>
</UserControl>