Skip to content

Commit ac956bc

Browse files
committed
Redesgin settings panel for program plugin
1 parent 6d4919f commit ac956bc

File tree

2 files changed

+33
-43
lines changed

2 files changed

+33
-43
lines changed

Flow.Launcher/Resources/CustomControlTemplate.xaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5588,10 +5588,18 @@
55885588

55895589
<!-- Settings Panel -->
55905590
<Thickness x:Key="SettingPanelMargin">70,9,18,9</Thickness>
5591+
55915592
<Thickness x:Key="SettingPanelItemLeftMargin">9,0,0,0</Thickness>
55925593
<Thickness x:Key="SettingPanelItemRightMargin">0,0,9,0</Thickness>
55935594
<Thickness x:Key="SettingPanelItemTopBottomMargin">0,9,0,9</Thickness>
55945595

55955596
<Thickness x:Key="SettingPanelItemLeftTopBottomMargin">9,9,0,9</Thickness>
55965597
<Thickness x:Key="SettingPanelItemRightTopBottomMargin">0,9,9,9</Thickness>
5598+
5599+
<Style x:Key="SettingPanelSeperatorStyle" TargetType="Separator">
5600+
<Setter Property="Margin" Value="-70 9 -18 9" />
5601+
<Setter Property="Height" Value="1" />
5602+
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
5603+
<Setter Property="BorderThickness" Value="1" />
5604+
</Style>
55975605
</ResourceDictionary>

Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,124 +10,108 @@
1010
<UserControl.Resources>
1111
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
1212
</UserControl.Resources>
13-
<Grid Margin="0">
13+
<Grid Margin="{StaticResource SettingPanelMargin}">
1414
<Grid.RowDefinitions>
1515
<RowDefinition Height="Auto" />
1616
<RowDefinition Height="Auto" />
1717
<RowDefinition Height="*" />
1818
<RowDefinition Height="Auto" />
1919
</Grid.RowDefinitions>
20-
<DockPanel
21-
Margin="70 10 0 8"
22-
HorizontalAlignment="Stretch"
23-
LastChildFill="True">
20+
<DockPanel HorizontalAlignment="Stretch" LastChildFill="True">
2421
<TextBlock
2522
MinWidth="120"
26-
Margin="0 5 10 0"
23+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
2724
Text="{DynamicResource flowlauncher_plugin_program_index_source}" />
2825
<WrapPanel
2926
Width="Auto"
30-
Margin="0 0 14 0"
27+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
3128
HorizontalAlignment="Right"
3229
DockPanel.Dock="Right">
3330
<CheckBox
3431
Name="UWPEnabled"
35-
Margin="12 0 12 0"
32+
Margin="{StaticResource SettingPanelItemRightMargin}"
3633
Content="{DynamicResource flowlauncher_plugin_program_index_uwp}"
3734
IsChecked="{Binding EnableUWP}"
3835
ToolTip="{DynamicResource flowlauncher_plugin_program_index_uwp_tooltip}"
3936
Visibility="{Binding ShowUWPCheckbox, Converter={StaticResource BooleanToVisibilityConverter}}" />
4037
<CheckBox
4138
Name="StartMenuEnabled"
42-
Margin="12 0 12 0"
39+
Margin="{StaticResource SettingPanelItemRightMargin}"
4340
Content="{DynamicResource flowlauncher_plugin_program_index_start}"
4441
IsChecked="{Binding EnableStartMenuSource}"
4542
ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" />
4643
<CheckBox
4744
Name="RegistryEnabled"
48-
Margin="12 0 12 0"
45+
Margin="{StaticResource SettingPanelItemRightMargin}"
4946
Content="{DynamicResource flowlauncher_plugin_program_index_registry}"
5047
IsChecked="{Binding EnableRegistrySource}"
5148
ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
5249
<CheckBox
5350
Name="PATHEnabled"
54-
Margin="12 0 12 0"
5551
Content="{DynamicResource flowlauncher_plugin_program_index_PATH}"
5652
IsChecked="{Binding EnablePATHSource}"
5753
ToolTip="{DynamicResource flowlauncher_plugin_program_index_PATH_tooltip}" />
5854
</WrapPanel>
5955
</DockPanel>
60-
6156
<StackPanel
6257
Grid.Row="1"
6358
HorizontalAlignment="Stretch"
6459
Orientation="Vertical">
65-
<Separator
66-
Height="1"
67-
BorderBrush="{DynamicResource Color03B}"
68-
BorderThickness="1" />
69-
<DockPanel
70-
Margin="70 10 0 8"
71-
HorizontalAlignment="Stretch"
72-
LastChildFill="True">
60+
<Separator Style="{StaticResource SettingPanelSeperatorStyle}" />
61+
<DockPanel HorizontalAlignment="Stretch" LastChildFill="True">
7362
<TextBlock
7463
MinWidth="120"
75-
Margin="0 5 10 0"
64+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
7665
Text="{DynamicResource flowlauncher_plugin_program_index_option}" />
7766
<WrapPanel
7867
Width="Auto"
79-
Margin="0 0 14 0"
68+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
8069
HorizontalAlignment="Right"
8170
DockPanel.Dock="Right">
8271
<CheckBox
83-
Margin="12 0 12 0"
72+
Margin="{StaticResource SettingPanelItemRightMargin}"
8473
Content="{DynamicResource flowlauncher_plugin_program_enable_hidelnkpath}"
8574
IsChecked="{Binding HideAppsPath}"
8675
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_hidelnkpath_tooltip}" />
8776
<CheckBox
88-
Margin="12 0 12 0"
77+
Margin="{StaticResource SettingPanelItemRightMargin}"
8978
Content="{DynamicResource flowlauncher_plugin_program_enable_hideuninstallers}"
9079
IsChecked="{Binding HideUninstallers}"
9180
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_hideuninstallers_tooltip}" />
9281
<CheckBox
93-
Margin="12 0 12 0"
82+
Margin="{StaticResource SettingPanelItemRightMargin}"
9483
Content="{DynamicResource flowlauncher_plugin_program_enable_description}"
9584
IsChecked="{Binding EnableDescription}"
9685
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" />
9786
<CheckBox
98-
Margin="12 0 12 0"
9987
Content="{DynamicResource flowlauncher_plugin_program_enable_hideduplicatedwindowsapp}"
10088
IsChecked="{Binding HideDuplicatedWindowsApp}"
10189
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_hideduplicatedwindowsapp_tooltip}" />
10290
</WrapPanel>
10391
</DockPanel>
104-
<Separator
105-
Height="1"
106-
BorderBrush="{DynamicResource Color03B}"
107-
BorderThickness="1" />
92+
<Separator Style="{StaticResource SettingPanelSeperatorStyle}" />
10893
<StackPanel
109-
Margin="60 0 0 2"
11094
HorizontalAlignment="Left"
11195
VerticalAlignment="Center"
11296
Orientation="Horizontal">
11397
<Button
11498
x:Name="btnLoadAllProgramSource"
11599
MinWidth="120"
116-
Margin="10 10 5 10"
100+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
117101
HorizontalAlignment="Right"
118102
Click="btnLoadAllProgramSource_OnClick"
119103
Content="{DynamicResource flowlauncher_plugin_program_all_programs}" />
120104
<Button
121105
x:Name="btnProgramSuffixes"
122106
MinWidth="120"
123-
Margin="5 10 5 10"
107+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
124108
HorizontalAlignment="Right"
125109
Click="BtnProgramSuffixes_OnClick"
126110
Content="{DynamicResource flowlauncher_plugin_program_suffixes}" />
127111
<Button
128112
x:Name="btnReindex"
129113
MinWidth="120"
130-
Margin="5 10 5 10"
114+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
131115
HorizontalAlignment="Right"
132116
Click="btnReindex_Click"
133117
Content="{DynamicResource flowlauncher_plugin_program_reindex}" />
@@ -140,12 +124,13 @@
140124
x:Name="progressBarIndexing"
141125
Width="80"
142126
Height="20"
127+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
143128
IsIndeterminate="True"
144129
Maximum="100"
145130
Minimum="0" />
146131
<TextBlock
147132
Height="20"
148-
Margin="10 0 0 0"
133+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
149134
HorizontalAlignment="Center"
150135
Text="{DynamicResource flowlauncher_plugin_program_indexing}" />
151136
</StackPanel>
@@ -154,7 +139,7 @@
154139
<ListView
155140
x:Name="programSourceView"
156141
Grid.Row="2"
157-
Margin="70 0 20 0"
142+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
158143
AllowDrop="True"
159144
BorderBrush="DarkGray"
160145
BorderThickness="1"
@@ -203,27 +188,24 @@
203188
</GridView>
204189
</ListView.View>
205190
</ListView>
206-
<DockPanel
207-
Grid.Row="3"
208-
Grid.RowSpan="1"
209-
Margin="0 0 20 0">
191+
<DockPanel Grid.Row="3">
210192
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
211193
<Button
212194
x:Name="btnProgramSourceStatus"
213195
MinWidth="100"
214-
Margin="10"
196+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
215197
Click="btnProgramSourceStatus_OnClick"
216198
Content="{DynamicResource flowlauncher_plugin_program_disable}" />
217199
<Button
218200
x:Name="btnEditProgramSource"
219201
MinWidth="100"
220-
Margin="10"
202+
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
221203
Click="btnEditProgramSource_OnClick"
222204
Content="{DynamicResource flowlauncher_plugin_program_edit}" />
223205
<Button
224206
x:Name="btnAddProgramSource"
225207
MinWidth="100"
226-
Margin="10 10 0 10"
208+
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
227209
Click="btnAddProgramSource_OnClick"
228210
Content="{DynamicResource flowlauncher_plugin_program_add}" />
229211
</StackPanel>

0 commit comments

Comments
 (0)