016abafee4
实测部分按钮(如新设置的云储存按钮)仍然有问题 统一设置所有ScrollViewer控件的PanningMode为VerticalOnly,防止水平滚动干扰用户体验 Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>
141 lines
10 KiB
XML
141 lines
10 KiB
XML
<UserControl x:Class="Ink_Canvas.Windows.SettingsViews.SearchPanel"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="691" d:DesignWidth="910">
|
|
<Grid x:Name="SearchPanelMainGrid" Background="#fafafa" Margin="250,0,0,0">
|
|
<!-- 搜索框区域 -->
|
|
<Grid Height="48" VerticalAlignment="Top" Margin="0,0,0,0">
|
|
<Border x:Name="SearchPanelTopBarBorder" Height="48" CornerRadius="0,6,0,0" Background="#fafafa">
|
|
<Border.Effect>
|
|
<DropShadowEffect Direction="-90" ShadowDepth="3" BlurRadius="4" Color="#000000" Opacity="0.25"/>
|
|
</Border.Effect>
|
|
</Border>
|
|
<Grid Margin="0,0,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<!-- 搜索输入框 -->
|
|
<Border x:Name="SearchInputBorder" Grid.Column="0" Margin="60,8,12,8" Background="White" CornerRadius="8" BorderBrush="#e6e6e6" BorderThickness="1">
|
|
<Grid>
|
|
<Image Width="16" Height="16" Margin="12,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center">
|
|
<Image.Source>
|
|
<DrawingImage>
|
|
<DrawingImage.Drawing>
|
|
<DrawingGroup ClipGeometry="M0,0 V17 H16 V0 H0 Z">
|
|
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,17z M0,0z M6.9333,0.111572C3.11689,0.111572 -5.16259E-07,3.22999 -5.16259E-07,7.04827 -5.16259E-07,10.8665 3.11689,13.9829 6.9333,13.9829 8.45757,13.9829 9.86954,13.4831 11.0166,12.6427L14.1583,15.7858C15.1805,16.7869,16.6805,15.2528,15.6583,14.2518L12.5333,11.1252C13.3704,9.97933 13.8666,8.57003 13.8666,7.04827 13.8666,3.22999 10.7497,0.111572 6.9333,0.111572z M6.9333,2.24594C9.59676,2.24594 11.7333,4.38351 11.7333,7.04827 11.7333,9.71302 9.59676,11.8485 6.9333,11.8485 4.26985,11.8485 2.13332,9.71302 2.13332,7.04827 2.13332,4.38351 4.26985,2.24594 6.9333,2.24594z" />
|
|
</DrawingGroup>
|
|
</DrawingImage.Drawing>
|
|
</DrawingImage>
|
|
</Image.Source>
|
|
</Image>
|
|
<TextBox Name="SearchTextBox"
|
|
FontSize="14"
|
|
Foreground="#2e3436"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
Padding="40,0,12,0"
|
|
VerticalContentAlignment="Center"
|
|
KeyDown="SearchTextBox_KeyDown"
|
|
TextChanged="SearchTextBox_TextChanged"
|
|
GotFocus="SearchTextBox_GotFocus"/>
|
|
</Grid>
|
|
</Border>
|
|
<!-- 关闭按钮 -->
|
|
<Border Grid.Column="1" CornerRadius="8" Background="#33ef4444" Width="34" Height="34" Margin="0,0,8,0" HorizontalAlignment="Right" VerticalAlignment="Center" MouseLeftButtonDown="CloseSearchButton_Click" Cursor="Hand">
|
|
<Image Width="12" Height="12">
|
|
<Image.Source>
|
|
<DrawingImage>
|
|
<DrawingImage.Drawing>
|
|
<DrawingGroup ClipGeometry="M0,0 V12 H12 V0 H0 Z">
|
|
<GeometryDrawing Brush="#991b1b" Geometry="F1 M12,12z M0,0z M0.999846,0C0.734646,4.07258E-05 0.480321,0.105424 0.292816,0.29297 0.105327,0.4805 0,0.734821 0,1 0,1.26518 0.105327,1.5195 0.292816,1.70703L4.58579,6 0.292816,10.293C0.105327,10.4805 0,10.7348 0,11 0,11.2652 0.105327,11.5195 0.292816,11.707 0.480347,11.8945 0.734668,11.9998 0.999846,11.9998 1.26503,11.9998 1.51935,11.8945 1.70688,11.707L5.99985,7.41406 10.2928,11.707C10.4803,11.8945 10.7347,11.9998 10.9998,11.9998 11.265,11.9998 11.5193,11.8945 11.7069,11.707 11.8944,11.5195 11.9997,11.2652 11.9997,11 11.9997,10.7348 11.8944,10.4805 11.7069,10.293L7.41391,6 11.7069,1.70703C11.8944,1.5195 11.9997,1.26518 11.9997,1 11.9997,0.734821 11.8944,0.4805 11.7069,0.29297 11.5194,0.105424 11.265,4.07258E-05 10.9998,0 10.7346,4.07258E-05 10.4803,0.105424 10.2928,0.29297L5.99985,4.58594 1.70688,0.29297C1.51937,0.105424,1.26505,4.07258E-05,0.999846,0z" />
|
|
</DrawingGroup>
|
|
</DrawingImage.Drawing>
|
|
</DrawingImage>
|
|
</Image.Source>
|
|
</Image>
|
|
</Border>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<!-- 搜索结果区域 -->
|
|
<ScrollViewer Margin="0,48,0,0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" IsManipulationEnabled="True" PanningMode="VerticalOnly">
|
|
<StackPanel Margin="60,12,60,24" Name="SearchResultsPanel">
|
|
<!-- 精准和拼音匹配结果 -->
|
|
<StackPanel Name="ExactMatchPanel" Visibility="Collapsed">
|
|
<TextBlock x:Name="ExactMatchTitle" Text="精准匹配" FontSize="13" FontWeight="Bold" Foreground="#2e3436" Margin="0,0,0,8"/>
|
|
<ItemsControl Name="ExactMatchItemsControl">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Background="White" CornerRadius="6" Margin="0,0,0,6" Padding="16,12" MouseLeftButtonDown="SearchResultItem_Click" Cursor="Hand" Tag="{Binding}">
|
|
<Grid>
|
|
<StackPanel Orientation="Vertical">
|
|
<TextBlock Text="{Binding Title}" FontSize="14" Foreground="#2e3436" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding Category}" FontSize="11" Foreground="#9a9996" Margin="0,4,0,0"/>
|
|
<TextBlock Text="{Binding Description}" FontSize="11" Foreground="#9a9996" Margin="0,2,0,0" TextWrapping="Wrap"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
|
|
<!-- 模糊匹配结果 -->
|
|
<StackPanel Name="FuzzyMatchPanel" Visibility="Collapsed" Margin="0,16,0,0">
|
|
<TextBlock x:Name="FuzzyMatchTitle" Text="模糊匹配" FontSize="13" FontWeight="Bold" Foreground="#2e3436" Margin="0,0,0,8"/>
|
|
<ItemsControl Name="FuzzyMatchItemsControl">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Background="White" CornerRadius="6" Margin="0,0,0,6" Padding="16,12" MouseLeftButtonDown="SearchResultItem_Click" Cursor="Hand" Tag="{Binding}">
|
|
<Grid>
|
|
<StackPanel Orientation="Vertical">
|
|
<TextBlock Text="{Binding Title}" FontSize="14" Foreground="#2e3436" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding Category}" FontSize="11" Foreground="#9a9996" Margin="0,4,0,0"/>
|
|
<TextBlock Text="{Binding Description}" FontSize="11" Foreground="#9a9996" Margin="0,2,0,0" TextWrapping="Wrap"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
|
|
<!-- 相关项结果 -->
|
|
<StackPanel Name="RelatedItemsPanel" Visibility="Collapsed" Margin="0,16,0,0">
|
|
<TextBlock x:Name="RelatedItemsTitle" Text="相关项" FontSize="13" FontWeight="Bold" Foreground="#2e3436" Margin="0,0,0,8"/>
|
|
<ItemsControl Name="RelatedItemsControl">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Background="White" CornerRadius="6" Margin="0,0,0,6" Padding="16,12" MouseLeftButtonDown="SearchResultItem_Click" Cursor="Hand" Tag="{Binding}">
|
|
<Grid>
|
|
<StackPanel Orientation="Vertical">
|
|
<TextBlock Text="{Binding Title}" FontSize="14" Foreground="#2e3436" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding Category}" FontSize="11" Foreground="#9a9996" Margin="0,4,0,0"/>
|
|
<TextBlock Text="{Binding Description}" FontSize="11" Foreground="#9a9996" Margin="0,2,0,0" TextWrapping="Wrap"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
|
|
<!-- 无结果提示 -->
|
|
<TextBlock Name="NoResultsText"
|
|
Text="未找到相关设置项"
|
|
FontSize="14"
|
|
Foreground="#9a9996"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,40,0,0"
|
|
Visibility="Collapsed"/>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</UserControl>
|
|
|