mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
157 lines
No EOL
6.9 KiB
XML
157 lines
No EOL
6.9 KiB
XML
<UserControl
|
|
x:Class="Flow.Launcher.Plugin.WebSearch.SettingsControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
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"
|
|
xmlns:vm="clr-namespace:Flow.Launcher.Plugin.WebSearch"
|
|
d:DataContext="{d:DesignInstance vm:SettingsViewModel}"
|
|
d:DesignHeight="300"
|
|
d:DesignWidth="500"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<Style x:Key="BrowserPathBoxStyle" TargetType="TextBox">
|
|
<Setter Property="Height" Value="28" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
</Style>
|
|
<DataTemplate x:Key="HeaderTemplateArrowUp">
|
|
<DockPanel>
|
|
<TextBlock HorizontalAlignment="Center" Text="{Binding}" />
|
|
<Path
|
|
x:Name="arrow"
|
|
Data="M 5,10 L 15,10 L 10,5 L 5,10"
|
|
Fill="gray"
|
|
StrokeThickness="1" />
|
|
</DockPanel>
|
|
</DataTemplate>
|
|
<DataTemplate x:Key="HeaderTemplateArrowDown">
|
|
<DockPanel>
|
|
<TextBlock HorizontalAlignment="Center" Text="{Binding}" />
|
|
<Path
|
|
x:Name="arrow"
|
|
Data="M 5,5 L 10,10 L 15,5 L 5,5"
|
|
Fill="gray"
|
|
StrokeThickness="1" />
|
|
</DockPanel>
|
|
</DataTemplate>
|
|
</UserControl.Resources>
|
|
<Grid Margin="14,14,14,0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition Height="56" />
|
|
<RowDefinition Height="50" />
|
|
</Grid.RowDefinitions>
|
|
<ListView
|
|
x:Name="SearchSourcesListView"
|
|
Grid.Row="0"
|
|
Margin="0,18,0,0"
|
|
BorderBrush="DarkGray"
|
|
BorderThickness="1"
|
|
GridViewColumnHeader.Click="SortByColumn"
|
|
ItemsSource="{Binding Settings.SearchSources}"
|
|
MouseDoubleClick="MouseDoubleClickItem"
|
|
SelectedItem="{Binding Settings.SelectedSearchSource}"
|
|
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
|
|
<ListView.View>
|
|
<GridView>
|
|
<GridViewColumn Width="50">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Image
|
|
Width="20"
|
|
Height="20"
|
|
Margin="6,0,0,0"
|
|
Source="{Binding Path=IconPath}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
|
|
<GridViewColumn
|
|
Width="130"
|
|
DisplayMemberBinding="{Binding ActionKeyword}"
|
|
Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding ActionKeyword}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
<GridViewColumn
|
|
Width="350"
|
|
DisplayMemberBinding="{Binding Title}"
|
|
Header="{DynamicResource flowlauncher_plugin_websearch_title}">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Title}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
<GridViewColumn
|
|
Width="80"
|
|
DisplayMemberBinding="{Binding Enabled}"
|
|
Header="{DynamicResource flowlauncher_plugin_websearch_enable}">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Enabled}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
</GridView>
|
|
</ListView.View>
|
|
</ListView>
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Right"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Width="100"
|
|
Margin="10"
|
|
Click="OnDeleteSearchSearchClick"
|
|
Content="{DynamicResource flowlauncher_plugin_websearch_delete}" />
|
|
<Button
|
|
Width="100"
|
|
Margin="10"
|
|
Click="OnEditSearchSourceClick"
|
|
Content="{DynamicResource flowlauncher_plugin_websearch_edit}" />
|
|
<Button
|
|
Width="100"
|
|
Margin="10,10,0,10"
|
|
Click="OnAddSearchSearchClick"
|
|
Content="{DynamicResource flowlauncher_plugin_websearch_add}" />
|
|
</StackPanel>
|
|
<Border
|
|
Grid.Row="2"
|
|
Margin="0,0,0,0"
|
|
HorizontalAlignment="Stretch"
|
|
BorderBrush="#cecece"
|
|
BorderThickness="0,1,0,0">
|
|
<DockPanel Margin="0,14,0,0" HorizontalAlignment="Right">
|
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
|
|
<Label
|
|
Margin="14,0,10,0"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Center"
|
|
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion_provider}" />
|
|
<ComboBox
|
|
Height="30"
|
|
Margin="0,0,20,0"
|
|
VerticalAlignment="Center"
|
|
FontSize="11"
|
|
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}"
|
|
ItemsSource="{Binding Settings.Suggestions}"
|
|
SelectedItem="{Binding Settings.SelectedSuggestion}" />
|
|
<Label
|
|
Margin="0,0,10,0"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Center"
|
|
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}" />
|
|
<CheckBox
|
|
Name="EnableSuggestion"
|
|
Margin="0,0,0,0"
|
|
IsChecked="{Binding Settings.EnableSuggestion}" />
|
|
</StackPanel>
|
|
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working -->
|
|
</DockPanel>
|
|
</Border>
|
|
</Grid>
|
|
</UserControl> |