mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 12:09:18 +08:00
67 lines
4.1 KiB
XML
67 lines
4.1 KiB
XML
<UserControl x:Class="Wox.Plugin.WebSearch.SettingsControl"
|
|
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:vm="clr-namespace:Wox.Plugin.WebSearch"
|
|
mc:Ignorable="d"
|
|
Background="White"
|
|
d:DataContext="{d:DesignInstance vm:SettingsViewModel}"
|
|
d:DesignHeight="300" d:DesignWidth="500">
|
|
<Grid Margin="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="48" />
|
|
<RowDefinition />
|
|
<RowDefinition Height="40" />
|
|
</Grid.RowDefinitions>
|
|
<StackPanel Orientation="Horizontal" Grid.Row="0">
|
|
<CheckBox IsChecked="{Binding Settings.EnableSuggestion}"
|
|
Margin="0 10 10 10"
|
|
Name="EnableSuggestion"
|
|
Content="{DynamicResource wox_plugin_websearch_enable_suggestion}" />
|
|
<ComboBox ItemsSource="{Binding Settings.Suggestions}"
|
|
SelectedItem="{Binding Settings.SelectedSuggestion}"
|
|
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}" Margin="10,3,10,10" />
|
|
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working -->
|
|
<Label Content="Open search in:" Margin="40 3 0 8"/>
|
|
<RadioButton Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="New window" Click="OnNewBrowserWindowClick" Margin="10" />
|
|
<RadioButton Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="New tab" Click="OnNewTabClick" Margin="10" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Row="1" HorizontalAlignment="Left" Margin="0,3,0,17" Width="480">
|
|
<Label Content="Set browser from path:" Height="28" Margin="0,0,350,0" HorizontalAlignment="Left" Width="130"/>
|
|
<TextBox x:Name="browserPathBox" HorizontalAlignment="Left" Height="21" Margin="138,-25,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="214" RenderTransformOrigin="0.502,-1.668"/>
|
|
<Button x:Name="viewButton" HorizontalAlignment="Left" Margin="381,-30,0,0" Width="58" Height="25" Click="OnChooseClick" FontSize="10" Content="Choose" />
|
|
</StackPanel>
|
|
<ListView ItemsSource="{Binding Settings.SearchSources}"
|
|
SelectedItem="{Binding Settings.SelectedSearchSource}"
|
|
Grid.Row="2">
|
|
<ListView.View>
|
|
<GridView>
|
|
<GridViewColumn Header="{DynamicResource wox_plugin_websearch_action_keyword}">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding ActionKeyword}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
<GridViewColumn Header="{DynamicResource wox_plugin_websearch_url}">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Url}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
</GridView>
|
|
</ListView.View>
|
|
</ListView>
|
|
<StackPanel Grid.Row="3" HorizontalAlignment="Right" Orientation="Horizontal">
|
|
<Button Click="OnDeleteSearchSearchClick" Width="100" Margin="10"
|
|
Content="{DynamicResource wox_plugin_websearch_delete}" />
|
|
<Button Click="OnEditSearchSourceClick" Width="100" Margin="10"
|
|
Content="{DynamicResource wox_plugin_websearch_edit}" />
|
|
<Button Click="OnAddSearchSearchClick" Width="100" Margin="10"
|
|
Content="{DynamicResource wox_plugin_websearch_add}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl> |