Skip to content

Commit 975d6ee

Browse files
committed
Redesgin settings panel for websearch plugin
1 parent 16b45d3 commit 975d6ee

File tree

1 file changed

+39
-43
lines changed

1 file changed

+39
-43
lines changed

Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,17 @@
3535
</DockPanel>
3636
</DataTemplate>
3737
</UserControl.Resources>
38-
<Grid Margin="0,4,0,0">
38+
<Grid Margin="{StaticResource SettingPanelMargin}">
3939
<Grid.RowDefinitions>
4040
<RowDefinition />
4141
<RowDefinition Height="56" />
42+
<RowDefinition />
4243
<RowDefinition Height="50" />
4344
</Grid.RowDefinitions>
4445
<ListView
4546
x:Name="SearchSourcesListView"
4647
Grid.Row="0"
47-
Margin="18,18,18,0"
48+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
4849
BorderBrush="DarkGray"
4950
BorderThickness="1"
5051
GridViewColumnHeader.Click="SortByColumn"
@@ -60,7 +61,7 @@
6061
<Image
6162
Width="20"
6263
Height="20"
63-
Margin="6,0,0,0"
64+
Margin="6 0 0 0"
6465
Source="{Binding Path=IconPath}" />
6566
</DataTemplate>
6667
</GridViewColumn.CellTemplate>
@@ -69,11 +70,11 @@
6970
<GridViewColumn
7071
Width="130"
7172
DisplayMemberBinding="{Binding ActionKeyword}"
72-
Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}"/>
73+
Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}" />
7374
<GridViewColumn
74-
Width="350"
75+
Width="239"
7576
DisplayMemberBinding="{Binding Title}"
76-
Header="{DynamicResource flowlauncher_plugin_websearch_title}"/>
77+
Header="{DynamicResource flowlauncher_plugin_websearch_title}" />
7778
<GridViewColumn Width="140" Header="{DynamicResource flowlauncher_plugin_websearch_enable}">
7879
<GridViewColumn.CellTemplate>
7980
<DataTemplate>
@@ -97,57 +98,52 @@
9798
</ListView>
9899
<StackPanel
99100
Grid.Row="1"
101+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
100102
HorizontalAlignment="Right"
101103
Orientation="Horizontal">
102104
<Button
103105
Width="100"
104-
Margin="10"
106+
Margin="{StaticResource SettingPanelItemLeftMargin}"
105107
Click="OnDeleteSearchSearchClick"
106108
Content="{DynamicResource flowlauncher_plugin_websearch_delete}" />
107109
<Button
108110
Width="100"
109-
Margin="10"
111+
Margin="{StaticResource SettingPanelItemLeftMargin}"
110112
Click="OnEditSearchSourceClick"
111113
Content="{DynamicResource flowlauncher_plugin_websearch_edit}" />
112114
<Button
113115
Width="100"
114-
Margin="10,10,18,10"
116+
Margin="{StaticResource SettingPanelItemLeftMargin}"
115117
Click="OnAddSearchSearchClick"
116118
Content="{DynamicResource flowlauncher_plugin_websearch_add}" />
117119
</StackPanel>
118-
<Border
119-
Grid.Row="2"
120-
Margin="0,0,0,0"
121-
HorizontalAlignment="Stretch"
122-
BorderBrush="{DynamicResource Color03B}"
123-
BorderThickness="0,1,0,0">
124-
<DockPanel HorizontalAlignment="Right">
125-
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
126-
<Label
127-
Margin="14,0,10,0"
128-
HorizontalAlignment="Right"
129-
VerticalAlignment="Center"
130-
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion_provider}" />
131-
<ComboBox
132-
Height="30"
133-
Margin="0,0,20,0"
134-
VerticalAlignment="Center"
135-
FontSize="11"
136-
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}"
137-
ItemsSource="{Binding Settings.Suggestions}"
138-
SelectedItem="{Binding Settings.SelectedSuggestion}" />
139-
<Label
140-
Margin="0,0,10,0"
141-
HorizontalAlignment="Right"
142-
VerticalAlignment="Center"
143-
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}" />
144-
<CheckBox
145-
Name="EnableSuggestion"
146-
Margin="0,0,8,0"
147-
IsChecked="{Binding Settings.EnableSuggestion}" />
148-
</StackPanel>
149-
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSearchSuggestion is not working -->
150-
</DockPanel>
151-
</Border>
120+
<Separator Grid.Row="2" Style="{StaticResource SettingPanelSeperatorStyle}" />
121+
<DockPanel
122+
Grid.Row="3"
123+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
124+
HorizontalAlignment="Right">
125+
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
126+
<Label
127+
HorizontalAlignment="Right"
128+
VerticalAlignment="Center"
129+
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion_provider}" />
130+
<ComboBox
131+
Height="30"
132+
Margin="{StaticResource SettingPanelItemLeftMargin}"
133+
VerticalAlignment="Center"
134+
FontSize="11"
135+
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}"
136+
ItemsSource="{Binding Settings.Suggestions}"
137+
SelectedItem="{Binding Settings.SelectedSuggestion}" />
138+
<CheckBox
139+
Name="EnableSuggestion"
140+
Margin="{StaticResource SettingPanelItemLeftMargin}"
141+
HorizontalAlignment="Right"
142+
VerticalAlignment="Center"
143+
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}"
144+
IsChecked="{Binding Settings.EnableSuggestion}" />
145+
</StackPanel>
146+
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSearchSuggestion is not working -->
147+
</DockPanel>
152148
</Grid>
153149
</UserControl>

0 commit comments

Comments
 (0)