Skip to content

Commit 45ff919

Browse files
committed
- Fix Enabled Label
- Fix Error when Click the Icon ColumnHeader
1 parent 520ef37 commit 45ff919

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<system:String x:Key="flowlauncher_plugin_websearch_delete">Delete</system:String>
1313
<system:String x:Key="flowlauncher_plugin_websearch_edit">Edit</system:String>
1414
<system:String x:Key="flowlauncher_plugin_websearch_add">Add</system:String>
15+
<system:String x:Key="flowlauncher_plugin_websearch_enabled_label">Enabled</system:String>
1516
<system:String x:Key="flowlauncher_plugin_websearch_true">Enabled</system:String>
1617
<system:String x:Key="flowlauncher_plugin_websearch_false">Disabled</system:String>
1718
<system:String x:Key="flowlauncher_plugin_websearch_confirm">Confirm</system:String>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
HorizontalAlignment="Left"
180180
VerticalAlignment="Center"
181181
FontSize="14"
182-
Text="{DynamicResource flowlauncher_plugin_websearch_enabled}" />
182+
Text="{DynamicResource flowlauncher_plugin_websearch_enabled_label}" />
183183
<CheckBox
184184
Grid.Row="4"
185185
Grid.Column="1"

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,29 @@ private void SortByColumn(object sender, RoutedEventArgs e)
9696
var columnBinding = headerClicked.Column.DisplayMemberBinding as Binding;
9797
var sortBy = columnBinding?.Path.Path ?? headerClicked.Column.Header as string;
9898

99-
Sort(sortBy, direction);
99+
if(sortBy != null) {
100+
Sort(sortBy, direction);
100101

101-
if (direction == ListSortDirection.Ascending)
102-
{
103-
headerClicked.Column.HeaderTemplate =
104-
Resources["HeaderTemplateArrowUp"] as DataTemplate;
105-
}
106-
else
107-
{
108-
headerClicked.Column.HeaderTemplate =
109-
Resources["HeaderTemplateArrowDown"] as DataTemplate;
110-
}
102+
if (direction == ListSortDirection.Ascending)
103+
{
104+
headerClicked.Column.HeaderTemplate =
105+
Resources["HeaderTemplateArrowUp"] as DataTemplate;
106+
}
107+
else
108+
{
109+
headerClicked.Column.HeaderTemplate =
110+
Resources["HeaderTemplateArrowDown"] as DataTemplate;
111+
}
111112

112-
// Remove arrow from previously sorted header
113-
if (_lastHeaderClicked != null && _lastHeaderClicked != headerClicked)
114-
{
115-
_lastHeaderClicked.Column.HeaderTemplate = null;
116-
}
113+
// Remove arrow from previously sorted header
114+
if (_lastHeaderClicked != null && _lastHeaderClicked != headerClicked)
115+
{
116+
_lastHeaderClicked.Column.HeaderTemplate = null;
117+
}
117118

118-
_lastHeaderClicked = headerClicked;
119-
_lastDirection = direction;
119+
_lastHeaderClicked = headerClicked;
120+
_lastDirection = direction;
121+
}
120122
}
121123
private void Sort(string sortBy, ListSortDirection direction)
122124
{

0 commit comments

Comments
 (0)