Skip to content

Commit c27761e

Browse files
committed
- Adjust Strings
- Add Auto Hide Styles
1 parent b559ad1 commit c27761e

File tree

2 files changed

+117
-27
lines changed

2 files changed

+117
-27
lines changed

Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns:system="clr-namespace:System;assembly=mscorlib">
55

66
<!-- Program setting -->
7+
<system:String x:Key="flowlauncher_plugin_program_reset">Reset Default</system:String>
78
<system:String x:Key="flowlauncher_plugin_program_delete">Delete</system:String>
89
<system:String x:Key="flowlauncher_plugin_program_edit">Edit</system:String>
910
<system:String x:Key="flowlauncher_plugin_program_add">Add</system:String>
@@ -35,10 +36,21 @@
3536
<system:String x:Key="flowlauncher_plugin_program_delete_program_source">Are you sure you want to delete the selected program sources?</system:String>
3637

3738
<system:String x:Key="flowlauncher_plugin_program_update">OK</system:String>
38-
<system:String x:Key="flowlauncher_plugin_program_only_index_tip">Flow Launcher will only index files that end with the following file types.</system:String>
39+
<system:String x:Key="flowlauncher_plugin_program_only_index_tip">Program Plugin will only index files that end with the following file types.</system:String>
3940
<system:String x:Key="flowlauncher_plugin_program_update_file_suffixes">Successfully updated file suffixes</system:String>
4041
<system:String x:Key="flowlauncher_plugin_program_suffixes_cannot_empty">File suffixes can't be empty</system:String>
4142

43+
<system:String x:Key="flowlauncher_plugin_program_suffixes_excutable_types">Excutable Types</system:String>
44+
<system:String x:Key="flowlauncher_plugin_program_suffixes_URL_types">URL Types</system:String>
45+
<system:String x:Key="flowlauncher_plugin_program_suffixes_custom_urls">Custom URL Types</system:String>
46+
<system:String x:Key="flowlauncher_plugin_program_suffixes_custom_file_types">Custom File Types</system:String>
47+
<system:String x:Key="flowlauncher_plugin_program_suffixes_tooltip">
48+
Insert file types what you want, Each file type should split by ';'. (ex>bat; py;)
49+
</system:String>
50+
<system:String x:Key="flowlauncher_plugin_program_protocol_tooltip">
51+
Insert protocol types what you want, Each protocol type should split by ';'. (ex>steam; epic;)
52+
</system:String>
53+
4254
<system:String x:Key="flowlauncher_plugin_program_run_as_different_user">Run As Different User</system:String>
4355
<system:String x:Key="flowlauncher_plugin_program_run_as_administrator">Run As Administrator</system:String>
4456
<system:String x:Key="flowlauncher_plugin_program_open_containing_folder">Open containing folder</system:String>

Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml

Lines changed: 104 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:ui="http://schemas.modernwpf.com/2019"
78
Title="{DynamicResource flowlauncher_plugin_program_suffixes}"
8-
Width="700"
9+
Width="600"
910
Background="{DynamicResource PopuBGColor}"
1011
Foreground="{DynamicResource PopupTextColor}"
1112
ResizeMode="NoResize"
@@ -15,6 +16,49 @@
1516
<WindowChrome.WindowChrome>
1617
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
1718
</WindowChrome.WindowChrome>
19+
<Window.Resources>
20+
<Style
21+
x:Key="CustomFileTypeTextBox"
22+
BasedOn="{StaticResource DefaultTextBoxStyle}"
23+
TargetType="TextBox">
24+
<Setter Property="Visibility" Value="Collapsed" />
25+
<Style.Triggers>
26+
<DataTrigger Binding="{Binding ElementName=CustomFiles, Path=IsChecked}" Value="True">
27+
<Setter Property="Visibility" Value="Visible" />
28+
</DataTrigger>
29+
</Style.Triggers>
30+
</Style>
31+
<Style
32+
x:Key="CustomURLTypeTextBox"
33+
BasedOn="{StaticResource DefaultTextBoxStyle}"
34+
TargetType="TextBox">
35+
<Setter Property="Visibility" Value="Collapsed" />
36+
<Style.Triggers>
37+
<DataTrigger Binding="{Binding ElementName=CustomProtocol, Path=IsChecked}" Value="True">
38+
<Setter Property="Visibility" Value="Visible" />
39+
</DataTrigger>
40+
</Style.Triggers>
41+
</Style>
42+
43+
<Style x:Key="SuffixToolTip" TargetType="TextBlock">
44+
<Setter Property="Visibility" Value="Collapsed" />
45+
<Style.Triggers>
46+
<DataTrigger Binding="{Binding ElementName=tbSuffixes, Path=IsFocused}" Value="True">
47+
<Setter Property="Visibility" Value="Visible" />
48+
</DataTrigger>
49+
</Style.Triggers>
50+
</Style>
51+
52+
<Style x:Key="URLToolTip" TargetType="TextBlock">
53+
<Setter Property="Visibility" Value="Collapsed" />
54+
<Style.Triggers>
55+
<DataTrigger Binding="{Binding ElementName=tbProtocols, Path=IsFocused}" Value="True">
56+
<Setter Property="Visibility" Value="Visible" />
57+
</DataTrigger>
58+
</Style.Triggers>
59+
</Style>
60+
</Window.Resources>
61+
1862
<Grid>
1963
<Grid.RowDefinitions>
2064
<RowDefinition Height="auto" />
@@ -70,47 +114,74 @@
70114
FontSize="14"
71115
Text="{DynamicResource flowlauncher_plugin_program_only_index_tip}"
72116
TextWrapping="Wrap" />
117+
<Border>
118+
<TextBlock
119+
Margin="0,0,0,0"
120+
Style="{StaticResource URLToolTip}"
121+
Text="{DynamicResource flowlauncher_plugin_program_protocol_tooltip}"
122+
TextWrapping="Wrap" />
123+
</Border>
124+
125+
<Border>
126+
<TextBlock
127+
Margin="0,0,0,0"
128+
Style="{StaticResource SuffixToolTip}"
129+
Text="{DynamicResource flowlauncher_plugin_program_suffixes_tooltip}"
130+
TextWrapping="Wrap" />
131+
</Border>
132+
133+
73134
<!--
74135
<TextBox x:Name="tbSuffixes" Margin="0,20,0,20" />
75136
-->
76-
<Grid Margin="0,12,0,12">
137+
<Grid Margin="0,20,0,12">
77138
<Grid.ColumnDefinitions>
78-
<ColumnDefinition Width="290" />
79-
<ColumnDefinition Width="290" />
139+
<ColumnDefinition Width="250" />
140+
<ColumnDefinition Width="250" />
80141
</Grid.ColumnDefinitions>
81142

82-
<StackPanel Grid.Column="0" Margin="12,0,0,0">
143+
<StackPanel Grid.Column="0" Margin="0,0,0,0">
83144
<TextBlock
84145
Margin="0,0,0,8"
85-
FontSize="18"
86-
FontWeight="SemiBold">
87-
Excutable Types
88-
</TextBlock>
89-
<CheckBox Name="apprefMS" Margin="20,0,0,0">appref-ms</CheckBox>
90-
<CheckBox Name="EXE" Margin="20,0,0,0">EXE</CheckBox>
91-
<CheckBox Name="LNK" Margin="20,0,0,0">Lnk</CheckBox>
92-
<CheckBox Name="CustomFiles" Margin="20,0,0,0">Custom File Types</CheckBox>
93-
<TextBox x:Name="tbSuffixes" Margin="20,4,0,20" />
146+
FontSize="16"
147+
FontWeight="SemiBold"
148+
Text="{DynamicResource flowlauncher_plugin_program_suffixes_excutable_types}" />
149+
<CheckBox Name="apprefMS" Margin="10,0,0,0">appref-ms</CheckBox>
150+
<CheckBox Name="EXE" Margin="10,0,0,0">EXE</CheckBox>
151+
<CheckBox Name="LNK" Margin="10,0,0,0">Lnk</CheckBox>
152+
<CheckBox
153+
Name="CustomFiles"
154+
Margin="10,0,0,0"
155+
Content="{DynamicResource flowlauncher_plugin_program_suffixes_custom_file_types}" />
156+
<TextBox
157+
x:Name="tbSuffixes"
158+
Margin="10,4,0,0"
159+
Style="{StaticResource CustomFileTypeTextBox}" />
94160
</StackPanel>
95161

96162
<Border
97163
Grid.Column="1"
98-
Margin="12,0,0,0"
164+
Margin="20,0,0,0"
99165
Padding="20,0,0,0"
100-
BorderBrush="Black"
166+
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
101167
BorderThickness="1,0,0,0">
102168
<StackPanel>
103169
<TextBlock
104170
Margin="0,0,0,8"
105-
FontSize="18"
106-
FontWeight="SemiBold">
107-
URL Types
108-
</TextBlock>
109-
<CheckBox Name="steam" Margin="20,0,0,0">Steam Games</CheckBox>
110-
<CheckBox Name="epic" Margin="20,0,0,0">Epic Games</CheckBox>
111-
<CheckBox Name="http" Margin="20,0,0,0">Http/Https</CheckBox>
112-
<CheckBox Name="CustomProtocol" Margin="20,0,0,0">Custom URL Protocols</CheckBox>
113-
<TextBox x:Name="tbProtocols" Margin="0,4,0,20" />
171+
FontSize="16"
172+
FontWeight="SemiBold"
173+
Text="{DynamicResource flowlauncher_plugin_program_suffixes_URL_types}" />
174+
<CheckBox Name="steam" Margin="10,0,0,0">Steam Games</CheckBox>
175+
<CheckBox Name="epic" Margin="10,0,0,0">Epic Games</CheckBox>
176+
<CheckBox Name="http" Margin="10,0,0,0">Http/Https</CheckBox>
177+
<CheckBox
178+
Name="CustomProtocol"
179+
Margin="10,0,0,0"
180+
Content="{DynamicResource flowlauncher_plugin_program_suffixes_custom_urls}" />
181+
<TextBox
182+
x:Name="tbProtocols"
183+
Margin="10,4,0,0"
184+
Style="{StaticResource CustomURLTypeTextBox}" />
114185
</StackPanel>
115186
</Border>
116187
</Grid>
@@ -123,11 +194,18 @@
123194
BorderThickness="0,1,0,0">
124195
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
125196
<Button
126-
x:Name="btnCancel"
197+
x:Name="btnResetl"
127198
Height="30"
128199
MinWidth="140"
129200
Margin="0,0,5,0"
130201
Click="BtnCancel_OnClick"
202+
Content="{DynamicResource flowlauncher_plugin_program_reset}" />
203+
<Button
204+
x:Name="btnCancel"
205+
Height="30"
206+
MinWidth="140"
207+
Margin="5,0,5,0"
208+
Click="BtnCancel_OnClick"
131209
Content="{DynamicResource cancel}" />
132210

133211
<Button

0 commit comments

Comments
 (0)