Flow.Launcher/Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml
2022-12-31 10:43:07 -05:00

275 lines
13 KiB
XML

<Window
x:Class="Flow.Launcher.Plugin.Program.ProgramSuffixes"
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:ui="http://schemas.modernwpf.com/2019"
Title="{DynamicResource flowlauncher_plugin_program_suffixes}"
Width="600"
Background="{DynamicResource PopuBGColor}"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
Foreground="{DynamicResource PopupTextColor}"
ResizeMode="NoResize"
SizeToContent="Height"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
</WindowChrome.WindowChrome>
<Window.Resources>
<Style
x:Key="CustomFileTypeTextBox"
BasedOn="{StaticResource DefaultTextBoxStyle}"
TargetType="TextBox">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=CustomFiles, Path=IsChecked}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style
x:Key="CustomURLTypeTextBox"
BasedOn="{StaticResource DefaultTextBoxStyle}"
TargetType="TextBox">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=CustomProtocol, Path=IsChecked}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="SettingGroupBoxSuffixToolTip" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource Color00B}" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="Margin" Value="0,5,0,0" />
<Setter Property="Padding" Value="15,15,15,15" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=tbSuffixes, Path=IsFocused}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=tbSuffixes, Path=IsFocused}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="SettingGroupBoxURLToolTip" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource Color00B}" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="Margin" Value="0,5,0,0" />
<Setter Property="Padding" Value="15,15,15,15" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=tbProtocols, Path=IsFocused}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=tbProtocols, Path=IsFocused}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid x:Name="WindowArea">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="80" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="4"
Click="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Opacity" Value="0.5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Button>
</Grid>
</StackPanel>
<StackPanel Margin="26,12,26,0">
<StackPanel Margin="0,0,0,12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource flowlauncher_plugin_program_suffixes}"
TextAlignment="Left" />
</StackPanel>
<TextBlock
Margin="0,0,0,10"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_program_only_index_tip}"
TextWrapping="Wrap" />
<Border Style="{DynamicResource SettingGroupBoxURLToolTip}">
<TextBlock
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_program_protocol_tooltip}"
TextWrapping="Wrap" />
</Border>
<Border Style="{DynamicResource SettingGroupBoxSuffixToolTip}">
<TextBlock
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_program_suffixes_tooltip}"
TextWrapping="Wrap" />
</Border>
<Grid Margin="0,20,0,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="250" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="0,0,0,0">
<TextBlock
Margin="0,0,0,8"
FontSize="16"
FontWeight="SemiBold"
Text="{DynamicResource flowlauncher_plugin_program_suffixes_executable_types}" />
<CheckBox
Name="apprefMS"
Margin="10,0,0,0"
IsChecked="{Binding SuffixesStatus[appref-ms]}">
appref-ms
</CheckBox>
<CheckBox
Name="exe"
Margin="10,0,0,0"
IsChecked="{Binding SuffixesStatus[exe]}">
exe
</CheckBox>
<CheckBox
Name="lnk"
Margin="10,0,0,0"
IsChecked="{Binding SuffixesStatus[lnk]}">
lnk
</CheckBox>
<CheckBox
Name="CustomFiles"
Margin="10,0,0,0"
Content="{DynamicResource flowlauncher_plugin_program_suffixes_custom_file_types}"
IsChecked="{Binding UseCustomSuffixes}" />
<TextBox
x:Name="tbSuffixes"
Margin="10,4,0,10"
Style="{StaticResource CustomFileTypeTextBox}" />
</StackPanel>
<Border
Grid.Column="1"
Margin="20,0,0,10"
Padding="20,0,0,0"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="1,0,0,0">
<StackPanel>
<TextBlock
Margin="0,0,0,8"
FontSize="16"
FontWeight="SemiBold"
Text="{DynamicResource flowlauncher_plugin_program_suffixes_URL_types}" />
<CheckBox
Name="steam"
Margin="10,0,0,0"
Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_steam}"
IsChecked="{Binding ProtocolsStatus[steam]}" />
<CheckBox
Name="epic"
Margin="10,0,0,0"
Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_epic}"
IsChecked="{Binding ProtocolsStatus[epic]}" />
<CheckBox
Name="http"
Margin="10,0,0,0"
Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_http}"
IsChecked="{Binding ProtocolsStatus[http]}" />
<CheckBox
Name="CustomProtocol"
Margin="10,0,0,0"
Content="{DynamicResource flowlauncher_plugin_program_suffixes_custom_urls}"
IsChecked="{Binding UseCustomProtocols}" />
<TextBox
x:Name="tbProtocols"
Margin="10,4,0,0"
Style="{StaticResource CustomURLTypeTextBox}" />
</StackPanel>
</Border>
</Grid>
</StackPanel>
</StackPanel>
<Border
Grid.Row="1"
Background="{DynamicResource PopupButtonAreaBGColor}"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="0,1,0,0">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Button
x:Name="btnReset"
Height="30"
MinWidth="140"
Margin="0,0,5,0"
Click="BtnReset_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_reset}" />
<Button
x:Name="btnCancel"
Height="30"
MinWidth="140"
Margin="5,0,5,0"
Click="BtnCancel_OnClick"
Content="{DynamicResource cancel}" />
<Button
Height="30"
MinWidth="140"
Margin="5,0,0,0"
HorizontalAlignment="Right"
Click="BtnAdd_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_update}"
Style="{DynamicResource AccentButtonStyle}" />
</StackPanel>
</Border>
</Grid>
</Window>