mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 03:37:10 +08:00
395 lines
24 KiB
XML
395 lines
24 KiB
XML
<Window
|
|
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:wox="clr-namespace:Wox"
|
|
xmlns:vm="clr-namespace:Wox.ViewModel"
|
|
xmlns:image="clr-namespace:Wox.Infrastructure.Image;assembly=Wox.Infrastructure"
|
|
x:Class="Wox.SettingWindow"
|
|
mc:Ignorable="d"
|
|
Icon="Images\app.png"
|
|
Title="{DynamicResource wox_settings}"
|
|
ResizeMode="NoResize"
|
|
WindowStartupLocation="CenterScreen"
|
|
Height="600" Width="800" PreviewKeyDown="Window_PreviewKeyDown"
|
|
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}">
|
|
<TabControl Height="auto" SelectedIndex="{Binding SelectedTab}">
|
|
<TabItem Header="{DynamicResource general}" Height="24" VerticalAlignment="Top">
|
|
<StackPanel Orientation="Vertical">
|
|
<CheckBox IsChecked="{Binding Settings.StartWoxOnSystemStartup}" Margin="10">
|
|
<TextBlock Text="{DynamicResource startWoxOnSystemStartup}" />
|
|
</CheckBox>
|
|
<CheckBox Margin="10" IsChecked="{Binding Settings.HideOnStartup}">
|
|
<TextBlock Text="{DynamicResource hideOnStartup}" />
|
|
</CheckBox>
|
|
<CheckBox Margin="10" IsChecked="{Binding Settings.HideWhenDeactive}">
|
|
<TextBlock Text="{DynamicResource hideWoxWhenLoseFocus}" />
|
|
</CheckBox>
|
|
<CheckBox Margin="10" IsChecked="{Binding Settings.RememberLastLaunchLocation}">
|
|
<TextBlock Text="{DynamicResource rememberLastLocation}" />
|
|
</CheckBox>
|
|
<CheckBox Margin="10" IsChecked="{Binding Settings.IgnoreHotkeysOnFullscreen}">
|
|
<TextBlock Text="{DynamicResource ignoreHotkeysOnFullscreen}" />
|
|
</CheckBox>
|
|
<CheckBox Margin="10" IsChecked="{Binding Settings.AutoUpdates}"
|
|
Checked="OnAutoStartupChecked" Unchecked="OnAutoStartupUncheck">
|
|
<TextBlock Text="{DynamicResource autoUpdates}" />
|
|
</CheckBox>
|
|
<StackPanel Margin="10" Orientation="Horizontal">
|
|
<TextBlock Text="{DynamicResource language}" />
|
|
<ComboBox Margin="10 0 0 0" Width="120" SelectionChanged="OnLanguageChanged"
|
|
ItemsSource="{Binding Languages}" SelectedValue="{Binding Settings.Language}"
|
|
DisplayMemberPath="Display" SelectedValuePath="LanguageCode" />
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="10">
|
|
<TextBlock Text="{DynamicResource maxShowResults}" />
|
|
<ComboBox Margin="10 0 0 0" Width="45" ItemsSource="{Binding MaxResultsRange}"
|
|
SelectedItem="{Binding Settings.MaxResultsToShow}" />
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Margin="10" Text="{DynamicResource pythonDirectory}" />
|
|
<TextBox Width="300" Margin="10" Text="{Binding Settings.PluginSettings.PythonDirectory}" />
|
|
<Button Margin="10" Click="OnSelectPythonDirectoryClick"
|
|
Content="{DynamicResource selectPythonDirectory}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</TabItem>
|
|
<TabItem Header="{DynamicResource plugin}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="200" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<DockPanel Grid.Column="0">
|
|
<TextBlock DockPanel.Dock="Top" Margin="10" Cursor="Hand"
|
|
MouseUp="OnMorePluginsClicked" Foreground="Blue"
|
|
Text="{DynamicResource browserMorePlugins}" />
|
|
<ListBox SelectedIndex="0" SelectedItem="{Binding SelectedPlugin}"
|
|
ItemsSource="{Binding MetadataViewModels}"
|
|
Margin="10, 0, 10, 10" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal" Margin="3">
|
|
<Image Source="{Binding Image, IsAsync=True}"
|
|
Width="32" Height="32" />
|
|
<StackPanel Margin="3 0 3 0">
|
|
<TextBlock Text="{Binding Metadata.Name}"
|
|
ToolTip="{Binding Metadata.Name}" />
|
|
<TextBlock Text="{Binding Metadata.Description}"
|
|
ToolTip="{Binding Metadata.Description}"
|
|
Opacity="0.5" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</DockPanel>
|
|
<Grid Grid.Column="1">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<ContentControl DataContext="{Binding Path=SelectedPlugin}"
|
|
Grid.ColumnSpan="1" Grid.Row="0" Margin="10 10 10 0">
|
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="48" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Image Source="{Binding Image, IsAsync=True}"
|
|
Width="48" Height="48" HorizontalAlignment="Left" VerticalAlignment="Top" />
|
|
<Grid Margin="10,0,0,0" Grid.Column="1" HorizontalAlignment="Stretch">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{Binding Metadata.Name}"
|
|
ToolTip="{Binding Metadata.Name}"
|
|
Grid.Column="0"
|
|
Cursor="Hand" MouseUp="OnPluginNameClick" FontSize="24"
|
|
HorizontalAlignment="Left" />
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right"
|
|
VerticalAlignment="Bottom" Opacity="0.5">
|
|
<TextBlock Text="{DynamicResource author}" />
|
|
<TextBlock Text=": " />
|
|
<TextBlock Text="{Binding Metadata.Author}" ToolTip="{Binding Metadata.Author}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
<TextBlock Text="{Binding Metadata.Description}"
|
|
ToolTip="{Binding Metadata.Description}"
|
|
Grid.Row="1" Opacity="0.5" />
|
|
<DockPanel Grid.Row="2" Margin="0 10 0 8">
|
|
<CheckBox IsChecked="{Binding Metadata.Disabled}" Checked="OnPluginToggled"
|
|
Unchecked="OnPluginToggled">
|
|
<TextBlock Text="{DynamicResource disable}" />
|
|
</CheckBox>
|
|
<TextBlock Text="{DynamicResource actionKeywords}"
|
|
Visibility="{Binding ActionKeywordsVisibility}"
|
|
Margin="20 0 0 0" />
|
|
<TextBlock Text="{Binding ActionKeywordsText}"
|
|
Visibility="{Binding ActionKeywordsVisibility}"
|
|
ToolTip="Change Action Keywords"
|
|
Margin="5 0 0 0" Cursor="Hand" Foreground="Blue"
|
|
MouseUp="OnPluginActionKeywordsClick" />
|
|
<TextBlock Text="{Binding InitilizaTime}" Margin="10 0 0 0" />
|
|
<TextBlock Text="{Binding QueryTime}" Margin="10 0 0 0" />
|
|
<TextBlock Text="{DynamicResource pluginDirectory}"
|
|
HorizontalAlignment="Right" Cursor="Hand"
|
|
MouseUp="OnPluginDirecotyClick" Foreground="Blue" />
|
|
</DockPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</ContentControl>
|
|
|
|
<ContentControl Content="{Binding SettingProvider}"
|
|
Grid.ColumnSpan="1" Grid.Row="1"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
|
|
</Grid>
|
|
</Grid>
|
|
</TabItem>
|
|
<TabItem Header="{DynamicResource theme}" Selector.Selected="OnThemeTabSelected">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="200" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<DockPanel Grid.Column="0">
|
|
<TextBlock DockPanel.Dock="Top" Margin="10" HorizontalAlignment="Left" Cursor="Hand"
|
|
MouseUp="tbMoreThemes_MouseUp" Foreground="Blue"
|
|
Text="{DynamicResource browserMoreThemes}" />
|
|
<ListBox x:Name="Theme" Margin="10, 0, 10, 10"
|
|
SelectionChanged="ThemeComboBox_OnSelectionChanged" HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch" Width="180" />
|
|
</DockPanel>
|
|
<Grid Margin="0" Grid.Column="1">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition Height="100" />
|
|
</Grid.RowDefinitions>
|
|
<StackPanel x:Name="PreviewPanel" Grid.Row="0" Margin="0">
|
|
<StackPanel Orientation="Horizontal" Margin="10"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Border Width="500" Style="{DynamicResource WindowBorderStyle}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="50" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<TextBox Text="{DynamicResource helloWox}" IsReadOnly="True"
|
|
Style="{DynamicResource QueryBoxStyle}" Grid.Row="0" />
|
|
<wox:ResultListBox Grid.Row="1" x:Name="ResultListBoxPreview" />
|
|
</Grid>
|
|
</Border>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="1" Margin="0 10 0 10" Orientation="Vertical">
|
|
<StackPanel Orientation="Horizontal" Margin="2">
|
|
<TextBlock Text="{DynamicResource queryBoxFont}" />
|
|
<ComboBox Margin="10 -2 5 0" x:Name="QueryBoxFont"
|
|
ItemsSource="{x:Static Fonts.SystemFontFamilies}"
|
|
SelectionChanged="CbQueryBoxFont_OnSelectionChanged" HorizontalAlignment="Left"
|
|
VerticalAlignment="Top" Width="160" />
|
|
<ComboBox Margin="0 -2 0 0"
|
|
x:Name="QueryBoxFontFaces"
|
|
ItemsSource="{Binding SelectedValue.FamilyTypefaces, ElementName=QueryBoxFont}"
|
|
SelectionChanged="CbQueryBoxFontFaces_OnSelectionChanged"
|
|
HorizontalAlignment="Left" VerticalAlignment="Top" Width="120">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<ItemsControl ItemsSource="{Binding AdjustedFaceNames}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Value}" />
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="2">
|
|
<TextBlock Text="{DynamicResource resultItemFont}" />
|
|
<ComboBox Margin="5 -2 5 0" x:Name="ResultFontComboBox"
|
|
ItemsSource="{x:Static Fonts.SystemFontFamilies}"
|
|
SelectionChanged="OnResultFontSelectionChanged" HorizontalAlignment="Left"
|
|
VerticalAlignment="Top" Width="160" />
|
|
<ComboBox Margin="0 -2 0 0"
|
|
x:Name="ResultFontFacesComboBox"
|
|
ItemsSource="{Binding SelectedValue.FamilyTypefaces, ElementName=ResultFontComboBox}"
|
|
SelectionChanged="OnResultFontFacesSelectionChanged" HorizontalAlignment="Left"
|
|
VerticalAlignment="Top" Width="120">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<ItemsControl ItemsSource="{Binding AdjustedFaceNames}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Value}" />
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
</Grid>
|
|
</TabItem>
|
|
<TabItem Header="{DynamicResource hotkey}" Selector.Selected="OnThemeTabSelected">
|
|
<Grid Margin="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition />
|
|
<RowDefinition Height="50" />
|
|
</Grid.RowDefinitions>
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBlock VerticalAlignment="Center" Margin="0 0 10 0" Text="{DynamicResource woxHotkey}" />
|
|
<wox:HotkeyControl x:Name="HotkeyControl" />
|
|
</StackPanel>
|
|
<Grid Grid.Row="1">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="20" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<TextBlock VerticalAlignment="Center" Grid.Row="0" Margin="0 0 10 0"
|
|
Text="{DynamicResource customQueryHotkey}" />
|
|
<ListView x:Name="CustomHotkies" Margin="0 5 0 0" Grid.Row="1">
|
|
<ListView.View>
|
|
<GridView>
|
|
<GridViewColumn Header="{DynamicResource hotkey}" Width="180">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Hotkey}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
<GridViewColumn Header="{DynamicResource actionKeywords}" Width="500">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding ActionKeywords}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
</GridView>
|
|
</ListView.View>
|
|
</ListView>
|
|
|
|
</Grid>
|
|
<StackPanel Grid.Row="2" HorizontalAlignment="Right" Orientation="Horizontal">
|
|
<Button Click="BtnDeleteCustomHotkey_OnClick" Width="100"
|
|
Margin="10" Content="{DynamicResource delete}" />
|
|
<Button Click="BtnEditCustomHotkey_OnClick" Width="100" Margin="10"
|
|
Content="{DynamicResource edit}" />
|
|
<Button Click="BtnAddCustomeHotkey_OnClick" Width="100" Margin="10"
|
|
Content="{DynamicResource add}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</TabItem>
|
|
<TabItem Header="{DynamicResource proxy}" Height="22" VerticalAlignment="Top">
|
|
<StackPanel>
|
|
<CheckBox x:Name="ToggleProxy" Margin="10" Checked="ProxyToggled" Unchecked="ProxyToggled">
|
|
<TextBlock Text="{DynamicResource enableProxy}" />
|
|
</CheckBox>
|
|
<Grid Margin="10" IsEnabled="{Binding IsChecked, ElementName=ToggleProxy}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="80" />
|
|
<ColumnDefinition Width="220" />
|
|
<ColumnDefinition Width="80" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Border Grid.Row="0" Grid.Column="0" Padding="5">
|
|
<TextBlock Text="{DynamicResource server}" />
|
|
</Border>
|
|
<Border Grid.Row="0" Grid.Column="1" Padding="5">
|
|
<TextBox Width="200" HorizontalAlignment="Left" x:Name="ProxyServer" />
|
|
</Border>
|
|
<Border Grid.Row="0" Grid.Column="2" Padding="5">
|
|
<TextBlock Text="{DynamicResource port}" />
|
|
</Border>
|
|
<Border Grid.Row="0" Grid.Column="3" Padding="5">
|
|
<TextBox Width="50" HorizontalAlignment="Left" x:Name="ProxyPort" />
|
|
</Border>
|
|
<Border Grid.Row="1" Grid.Column="0" Padding="5">
|
|
<TextBlock Text="{DynamicResource userName}" />
|
|
</Border>
|
|
<Border Grid.Row="1" Grid.Column="1" Padding="5">
|
|
<TextBox Width="200" HorizontalAlignment="Left" x:Name="ProxyUserName" />
|
|
</Border>
|
|
<Border Grid.Row="1" Grid.Column="2" Padding="5">
|
|
<TextBlock Text="{DynamicResource password}" />
|
|
</Border>
|
|
<Border Grid.Row="1" Grid.Column="3" Padding="5">
|
|
<PasswordBox Width="200" HorizontalAlignment="Left" x:Name="ProxyPassword" />
|
|
</Border>
|
|
</Grid>
|
|
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsChecked, ElementName=ToggleProxy}">
|
|
<Button Width="80" HorizontalAlignment="Left" Margin="10" Click="btnTestProxy_Click"
|
|
Content="{DynamicResource testProxy}" />
|
|
<Button Width="80" HorizontalAlignment="Left" Margin="10" Click="btnSaveProxy_Click"
|
|
Content="{DynamicResource save}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</TabItem>
|
|
<TabItem Header="{DynamicResource about}">
|
|
<Grid>
|
|
<Grid.Resources>
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
<Setter Property="Margin" Value="10, 10, 0, 0" />
|
|
</Style>
|
|
</Grid.Resources>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock x:Name="ActivatedTimes" Grid.Row="0" Grid.ColumnSpan="3"
|
|
Text="{DynamicResource about_activate_times}" />
|
|
|
|
<TextBlock Grid.Column="0" Grid.Row="1" Text="{DynamicResource website}" />
|
|
<TextBlock Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left">
|
|
<Hyperlink NavigateUri="https://github.com/Wox-launcher/Wox" RequestNavigate="OnRequestNavigate">
|
|
https://github.com/Wox-launcher/Wox
|
|
</Hyperlink>
|
|
</TextBlock>
|
|
|
|
|
|
<TextBlock Grid.Column="0" Grid.Row="2" Text="{DynamicResource version}" />
|
|
<TextBlock Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" x:Name="Version" Text="1.0.0" />
|
|
|
|
<TextBlock Grid.Column="0" Grid.Row="3" Text="{DynamicResource releaseNotes}" />
|
|
<TextBlock Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left">
|
|
<Hyperlink NavigateUri="https://github.com/Wox-launcher/Wox/releases/latest"
|
|
RequestNavigate="OnRequestNavigate">
|
|
https://github.com/Wox-launcher/Wox/releases/latest
|
|
</Hyperlink>
|
|
</TextBlock>
|
|
|
|
<Button Grid.Column="0" Grid.Row="4" Content="{DynamicResource checkUpdates}"
|
|
HorizontalAlignment="Left" Margin="10 10 10 10" Click="OnCheckUpdates" />
|
|
<TextBlock Grid.Column="1" Grid.Row="4" Name="NewVersionTips" HorizontalAlignment="Left"
|
|
Text="{DynamicResource newVersionTips}" Visibility="Hidden" />
|
|
|
|
</Grid>
|
|
</TabItem>
|
|
</TabControl>
|
|
</Window> |