Flow.Launcher/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml

82 lines
4.8 KiB
Text
Raw Normal View History

2020-04-21 09:12:17 +00:00
<UserControl x:Class="Flow.Launcher.Plugin.WebSearch.SettingsControl"
2014-03-29 08:13:36 +00:00
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"
2020-04-21 09:12:17 +00:00
xmlns:vm="clr-namespace:Flow.Launcher.Plugin.WebSearch"
mc:Ignorable="d"
Background="White"
d:DataContext="{d:DesignInstance vm:SettingsViewModel}"
2015-01-07 10:45:55 +00:00
d:DesignHeight="300" d:DesignWidth="500">
2020-05-04 04:49:32 +00:00
<UserControl.Resources>
<Style TargetType="TextBox" x:Key="BrowserPathBoxStyle">
<Setter Property="Height" Value="28"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</UserControl.Resources>
<Grid Margin="15 0 0 0">
2014-03-29 08:13:36 +00:00
<Grid.RowDefinitions>
2020-05-04 04:49:32 +00:00
<RowDefinition Height="30" />
<RowDefinition Height="48" />
2020-05-04 04:49:32 +00:00
<RowDefinition Height="45" />
<RowDefinition />
2020-05-04 04:49:32 +00:00
<RowDefinition Height="50" />
2014-03-29 08:13:36 +00:00
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0">
<CheckBox IsChecked="{Binding Settings.EnableSuggestion}"
2020-05-04 04:49:32 +00:00
Margin="0 0 20 0"
Name="EnableSuggestion"
2020-04-21 12:54:41 +00:00
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}" />
<ComboBox ItemsSource="{Binding Settings.Suggestions}"
SelectedItem="{Binding Settings.SelectedSuggestion}"
2020-05-04 04:49:32 +00:00
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}" />
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working -->
</StackPanel>
2020-05-04 04:49:32 +00:00
<StackPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal">
<Label Content="Open search in:" Margin="0 15 20 0"/>
<RadioButton Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="New window" Click="OnNewBrowserWindowClick"
Margin="0 0 20 0"/>
<RadioButton Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="New tab" Click="OnNewTabClick" />
</StackPanel>
<StackPanel Grid.Row="2" HorizontalAlignment="Left" Margin="0 3 0 0">
<Label Content="Set browser from path:" Margin="0 0 350 0" HorizontalAlignment="Left" Width="140"/>
<TextBox x:Name="browserPathBox" HorizontalAlignment="Left" Margin="160,-22,0,0" TextChanged="OnBrowserPathTextChanged"
2020-05-04 04:49:32 +00:00
Width="214" Style="{StaticResource BrowserPathBoxStyle}"/>
<Button x:Name="viewButton" HorizontalAlignment="Left" Margin="400,-30,0,0"
Click="OnChooseClick" FontSize="13" Content="Choose" Width="80"/>
</StackPanel>
<ListView ItemsSource="{Binding Settings.SearchSources}"
SelectedItem="{Binding Settings.SelectedSearchSource}"
2020-05-04 04:49:32 +00:00
Grid.Row="3"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"
BorderBrush="DarkGray"
BorderThickness="1">
2014-03-29 08:13:36 +00:00
<ListView.View>
<GridView>
2020-04-21 12:54:41 +00:00
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}">
2014-03-29 08:13:36 +00:00
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding ActionKeyword}" />
2014-03-29 08:13:36 +00:00
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
2020-05-04 04:49:32 +00:00
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_websearch_url}" Width="418">
2014-03-29 08:13:36 +00:00
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Url}" />
2014-03-29 08:13:36 +00:00
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
2020-05-04 04:49:32 +00:00
<StackPanel Grid.Row="4" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Click="OnDeleteSearchSearchClick" Width="100" Margin="10"
2020-04-21 12:54:41 +00:00
Content="{DynamicResource flowlauncher_plugin_websearch_delete}" />
<Button Click="OnEditSearchSourceClick" Width="100" Margin="10"
2020-04-21 12:54:41 +00:00
Content="{DynamicResource flowlauncher_plugin_websearch_edit}" />
2020-05-14 10:08:38 +00:00
<Button Click="OnAddSearchSearchClick" Width="100" Margin="10 10 10 10"
2020-04-21 12:54:41 +00:00
Content="{DynamicResource flowlauncher_plugin_websearch_add}" />
2014-03-29 08:13:36 +00:00
</StackPanel>
</Grid>
</UserControl>