| 1 | <UserControl xmlns="https://github.com/avaloniaui" |
| 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | xmlns:vm="using:CascadeIDE.ViewModels" |
| 4 | xmlns:shell="using:CascadeIDE.Models.Shell" |
| 5 | x:Class="CascadeIDE.Views.CascadeChordHudStripView" |
| 6 | x:DataType="vm:MainWindowViewModel" |
| 7 | VerticalAlignment="Center"> |
| 8 | <!-- Зеркало состояния мелодии без TextBox: фокус остаётся в редакторе, символы идут по Key → латиница даже при RU раскладке (ADR 0060). --> |
| 9 | <Panel MinWidth="220" MaxWidth="400"> |
| 10 | <Border x:Name="ChordMirrorHost" |
| 11 | MinHeight="30" |
| 12 | MinWidth="200" |
| 13 | MaxWidth="400" |
| 14 | Padding="10,6" |
| 15 | Focusable="False" |
| 16 | Cursor="Arrow" |
| 17 | CornerRadius="4" |
| 18 | BorderThickness="1" |
| 19 | BorderBrush="{DynamicResource CascadeTheme.WorkspacePanelBorderBrush}" |
| 20 | Background="{DynamicResource CascadeTheme.CommandPaletteQueryBackground}" |
| 21 | ToolTip.Tip="{Binding CascadeChordOverlayCompactFooter}"> |
| 22 | <Grid> |
| 23 | <TextBlock FontFamily="Consolas,Cascadia Mono,Courier New,monospace" |
| 24 | FontSize="13" |
| 25 | Opacity="0.58" |
| 26 | Text="{Binding CascadeChordHudWatermark}" |
| 27 | TextTrimming="CharacterEllipsis" |
| 28 | VerticalAlignment="Center" |
| 29 | IsVisible="{Binding IsCascadeChordHudMirrorPlaceholderVisible}"/> |
| 30 | <TextBlock FontFamily="Consolas,Cascadia Mono,Courier New,monospace" |
| 31 | FontSize="13" |
| 32 | FontWeight="SemiBold" |
| 33 | Foreground="{DynamicResource CascadeTheme.CommandPaletteTitleForeground}" |
| 34 | Text="{Binding CascadeChordHudMelodyText}" |
| 35 | TextTrimming="CharacterEllipsis" |
| 36 | VerticalAlignment="Center" |
| 37 | IsVisible="{Binding IsCascadeChordHudMirrorMelodyVisible}"/> |
| 38 | </Grid> |
| 39 | </Border> |
| 40 | <Popup x:Name="ChordSuggestionsPopup" |
| 41 | PlacementTarget="{Binding #ChordMirrorHost}" |
| 42 | Placement="BottomEdgeAlignedLeft" |
| 43 | IsOpen="{Binding IsCascadeChordDropdownOpen, Mode=OneWay}" |
| 44 | IsLightDismissEnabled="True" |
| 45 | Closed="OnChordPopupClosed"> |
| 46 | <Border MinWidth="200" |
| 47 | MaxWidth="480" |
| 48 | MaxHeight="260" |
| 49 | Padding="0" |
| 50 | CornerRadius="6" |
| 51 | BorderThickness="1" |
| 52 | BorderBrush="{DynamicResource CascadeTheme.WorkspacePanelBorderBrush}" |
| 53 | Background="{DynamicResource CascadeTheme.CommandPaletteQueryBackground}" |
| 54 | BoxShadow="0 6 24 0 #48000000"> |
| 55 | <Grid RowDefinitions="Auto,*"> |
| 56 | <TextBlock Grid.Row="0" |
| 57 | Padding="10,8" |
| 58 | FontSize="12" |
| 59 | IsVisible="{Binding CascadeChordOverlayNoMatches}" |
| 60 | Foreground="{DynamicResource CascadeTheme.CommandPaletteUnavailableForeground}" |
| 61 | Text="Нет alias с таким префиксом"/> |
| 62 | <ListBox x:Name="ChordSuggestionList" |
| 63 | Grid.Row="1" |
| 64 | MaxHeight="220" |
| 65 | Background="Transparent" |
| 66 | BorderThickness="0" |
| 67 | IsVisible="{Binding HasChordDropdownItems}" |
| 68 | ItemsSource="{Binding CascadeChordOverlaySuggestions}" |
| 69 | SelectionChanged="OnChordSuggestionSelectionChanged"> |
| 70 | <ListBox.Styles> |
| 71 | <Style Selector="ListBoxItem"> |
| 72 | <Setter Property="Padding" Value="10,6"/> |
| 73 | <Setter Property="MinHeight" Value="32"/> |
| 74 | </Style> |
| 75 | <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
| 76 | <Setter Property="Background" Value="{DynamicResource CascadeTheme.ButtonHoverBackground}"/> |
| 77 | </Style> |
| 78 | </ListBox.Styles> |
| 79 | <ListBox.ItemTemplate> |
| 80 | <DataTemplate DataType="shell:CascadeChordOverlaySuggestion"> |
| 81 | <Grid ColumnDefinitions="Auto,*"> |
| 82 | <TextBlock Grid.Column="0" |
| 83 | FontFamily="Consolas,Cascadia Mono,Courier New,monospace" |
| 84 | FontSize="12.5" |
| 85 | Foreground="{DynamicResource CascadeTheme.CommandPaletteHotkeyPillForeground}" |
| 86 | Text="{Binding Alias}"/> |
| 87 | <TextBlock Grid.Column="1" |
| 88 | Margin="12,0,0,0" |
| 89 | FontSize="12" |
| 90 | TextTrimming="CharacterEllipsis" |
| 91 | Foreground="{DynamicResource CascadeTheme.CommandPaletteTitleForeground}" |
| 92 | Text="{Binding Title}"/> |
| 93 | </Grid> |
| 94 | </DataTemplate> |
| 95 | </ListBox.ItemTemplate> |
| 96 | </ListBox> |
| 97 | </Grid> |
| 98 | </Border> |
| 99 | </Popup> |
| 100 | </Panel> |
| 101 | </UserControl> |
| 102 | |