Forge
deeb25a2
1<UserControl xmlns="https://github.com/avaloniaui"
2 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3 xmlns:vm="using:CascadeIDE.ViewModels"
4 x:Class="CascadeIDE.Views.CommandPaletteView"
5 x:DataType="vm:MainWindowViewModel"
6 Focusable="True"
7 IsVisible="False">
8 <UserControl.Styles>
9 <!-- Плотные строки: keyboard-first, иерархия title > meta > hotkey pill -->
10 <Style Selector="ListBoxItem">
11 <Setter Property="Padding" Value="8,5"/>
12 <Setter Property="Margin" Value="0,1"/>
13 <Setter Property="Background" Value="Transparent"/>
14 <Setter Property="CornerRadius" Value="6"/>
15 </Style>
16 <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
17 <Setter Property="Background" Value="{DynamicResource CascadeTheme.CommandPaletteItemHoverBackground}"/>
18 </Style>
19 <Style Selector="ListBoxItem:selected /template/ ContentPresenter">
20 <Setter Property="Background" Value="{DynamicResource CascadeTheme.CommandPaletteItemSelectedBackground}"/>
21 </Style>
22 <Style Selector="TextBox.palette-query">
23 <Setter Property="FontSize" Value="14"/>
24 <Setter Property="Padding" Value="10,8"/>
25 <Setter Property="Background" Value="{DynamicResource CascadeTheme.CommandPaletteQueryBackground}"/>
26 <Setter Property="Foreground" Value="{DynamicResource CascadeTheme.CommandPaletteQueryForeground}"/>
27 <Setter Property="CaretBrush" Value="{DynamicResource CascadeTheme.CommandPaletteQueryCaretBrush}"/>
28 <Setter Property="BorderBrush" Value="{DynamicResource CascadeTheme.PanelTitleAccentBrush}"/>
29 <Setter Property="BorderThickness" Value="1"/>
30 <Setter Property="CornerRadius" Value="6"/>
31 </Style>
32 <Style Selector="TextBox.palette-query /template/ TextBlock#PART_Watermark">
33 <Setter Property="Foreground" Value="{DynamicResource CascadeTheme.CommandPaletteQueryPlaceholderForeground}"/>
34 </Style>
35 <Style Selector="Border.hotkey-pill">
36 <Setter Property="CornerRadius" Value="10"/>
37 <Setter Property="Padding" Value="8,2"/>
38 <Setter Property="BorderThickness" Value="1"/>
39 <Setter Property="BorderBrush" Value="{DynamicResource CascadeTheme.CommandPaletteHotkeyPillBorderBrush}"/>
40 <Setter Property="Background" Value="{DynamicResource CascadeTheme.CommandPaletteHotkeyPillBackground}"/>
41 </Style>
42 </UserControl.Styles>
43 <Border Background="{DynamicResource CascadeTheme.CommandPaletteDimmerOverlay}"
44 PointerPressed="OnDimmerPressed">
45 <Border MaxWidth="860"
46 MaxHeight="620"
47 Margin="40"
48 Padding="16"
49 HorizontalAlignment="Center"
50 VerticalAlignment="Center"
51 Background="{DynamicResource CascadeTheme.CommandPaletteSurfaceBackground}"
52 BorderBrush="{DynamicResource CascadeTheme.CommandPaletteSurfaceBorderBrush}"
53 BorderThickness="1"
54 CornerRadius="6"
55 PointerPressed="OnPanelPressed">
56 <Grid RowDefinitions="Auto,*,Auto">
57 <TextBox x:Name="SearchTextBox"
58 Classes="palette-query"
59 Grid.Row="0"
60 PlaceholderText="{Binding CommandPalettePlaceholderText}"
61 Text="{Binding CommandPaletteQuery, Mode=TwoWay}"/>
62 <ListBox Grid.Row="1"
63 Margin="0,10,0,0"
64 ItemsSource="{Binding FilteredCommandPaletteEntries}"
65 SelectedIndex="{Binding CommandPaletteSelectedIndex, Mode=TwoWay}"
66 Background="Transparent">
67 <ListBox.ItemTemplate>
68 <DataTemplate DataType="vm:IdeCommandPaletteRowViewModel">
69 <Grid ColumnDefinitions="*,Auto"
70 Opacity="{Binding RowOpacity}">
71 <StackPanel Grid.Column="0" Orientation="Vertical" Spacing="3">
72 <TextBlock Text="{Binding Title}"
73 FontWeight="SemiBold"
74 FontSize="{Binding PaletteTitleFontSize}"
75 Foreground="{DynamicResource CascadeTheme.CommandPaletteTitleForeground}"/>
76 <TextBlock Text="{Binding Subtitle}"
77 FontSize="12.5"
78 FontFamily="Consolas,Cascadia Mono,Courier New,monospace"
79 TextWrapping="Wrap"
80 Opacity="0.95"
81 Foreground="{DynamicResource CascadeTheme.CommandPaletteMetaForeground}"/>
82 <TextBlock Text="{Binding UnavailableHint}"
83 IsVisible="{Binding ShowUnavailableHint}"
84 Opacity="0.98"
85 FontSize="12"
86 Foreground="{DynamicResource CascadeTheme.CommandPaletteUnavailableForeground}"/>
87 </StackPanel>
88 <Border Grid.Column="1"
89 Classes="hotkey-pill">
90 <TextBlock Text="{Binding HotkeyHint}"
91 FontSize="10.5"
92 FontFamily="Consolas,Cascadia Mono,Courier New,monospace"
93 Opacity="0.95"
94 VerticalAlignment="Center"
95 Foreground="{DynamicResource CascadeTheme.CommandPaletteHotkeyPillForeground}"/>
96 </Border>
97 </Grid>
98 </DataTemplate>
99 </ListBox.ItemTemplate>
100 </ListBox>
101 <TextBlock Grid.Row="2"
102 Margin="0,10,0,0"
103 FontSize="12"
104 LineHeight="17"
105 TextWrapping="Wrap"
106 Opacity="0.92"
107 Foreground="{DynamicResource CascadeTheme.CommandPaletteMetaForeground}"
108 Text="{Binding CommandPaletteFooterHint}"/>
109 </Grid>
110 </Border>
111 </Border>
112</UserControl>
113
View only · write via MCP/CIDE