Flow.Launcher/Flow.Launcher.Avalonia/Views/Controls/HotkeyControl.axaml
Hongtao Zhang 0f9b9329dd Add hotkey recorder with manual modifier tracking
- Add HotkeyRecorderDialog with global keyboard hook for capturing hotkeys
- Implement manual modifier state tracking to handle swallowed key events
- Add HotkeyControl button that opens the recorder dialog
- Add CheckAvailability and RemoveToggleHotkey to HotKeyMapper
- Expose GetKeyFromVk helper in GlobalHotkey infrastructure
- Add Settings pages (General, Plugin, Theme, Proxy, About)
- Add PreviewPanel for result previews in main window
- Fix hook reuse issue by clearing callback on close instead of disposing
2026-01-18 02:10:53 -08:00

36 lines
1.7 KiB
XML

<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>