Skip to content

Commit 4153aa9

Browse files
authored
Merge pull request #1612 from onesounds/FixBoolToTranslation
Translatable Bool in List view
2 parents 50b5a0e + 00e88bc commit 4153aa9

File tree

6 files changed

+63
-26
lines changed

6 files changed

+63
-26
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
DockPanel.Dock="Right" />
102102
<TextBox
103103
Name="Directory"
104-
MinWidth="300"
104+
Width="350"
105105
Margin="10"
106106
HorizontalAlignment="Stretch"
107107
VerticalAlignment="Center" />

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
<system:String x:Key="flowlauncher_plugin_program_enable">Enable</system:String>
1313
<system:String x:Key="flowlauncher_plugin_program_enabled">Enabled</system:String>
1414
<system:String x:Key="flowlauncher_plugin_program_disable">Disable</system:String>
15+
<system:String x:Key="flowlauncher_plugin_program_status">Status</system:String>
16+
<system:String x:Key="flowlauncher_plugin_program_true">Enabled</system:String>
17+
<system:String x:Key="flowlauncher_plugin_program_false">Disabled</system:String>
1518
<system:String x:Key="flowlauncher_plugin_program_location">Location</system:String>
1619
<system:String x:Key="flowlauncher_plugin_program_all_programs">All Programs</system:String>
1720
<system:String x:Key="flowlauncher_plugin_program_suffixes">File Type</system:String>
@@ -28,7 +31,7 @@
2831
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath">Hide app path</system:String>
2932
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath_tooltip">For executable files such as UWP or lnk, hide the file path from being visible</system:String>
3033
<system:String x:Key="flowlauncher_plugin_program_enable_description">Search in Program Description</system:String>
31-
<system:String x:Key="flowlauncher_plugin_program_enable_description_tooltip">Disabling this will also stop Flow from searching via the program desciption</system:String>
34+
<system:String x:Key="flowlauncher_plugin_program_enable_description_tooltip">Flow will search program's description</system:String>
3235
<system:String x:Key="flowlauncher_plugin_program_suffixes_header">Suffixes</system:String>
3336
<system:String x:Key="flowlauncher_plugin_program_max_depth_header">Max Depth</system:String>
3437

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

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@
9090
BorderBrush="{DynamicResource Color03B}"
9191
BorderThickness="1" />
9292
<StackPanel
93-
Width="Auto"
94-
Height="55"
95-
Margin="60,6,0,0"
93+
Margin="60,0,0,2"
9694
HorizontalAlignment="Left"
95+
VerticalAlignment="Center"
9796
Orientation="Horizontal">
9897
<Button
9998
x:Name="btnLoadAllProgramSource"
@@ -149,7 +148,8 @@
149148
MouseDoubleClick="programSourceView_MouseDoubleClick"
150149
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
151150
SelectionChanged="programSourceView_SelectionChanged"
152-
SelectionMode="Extended">
151+
SelectionMode="Extended"
152+
SizeChanged="ListView_SizeChanged">
153153
<ListView.View>
154154
<GridView>
155155
<GridViewColumn Width="150" Header="{DynamicResource flowlauncher_plugin_program_name}">
@@ -159,20 +159,28 @@
159159
</DataTemplate>
160160
</GridViewColumn.CellTemplate>
161161
</GridViewColumn>
162-
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_program_enabled}">
162+
<GridViewColumn Width="90" Header="{DynamicResource flowlauncher_plugin_program_status}">
163163
<GridViewColumn.CellTemplate>
164164
<DataTemplate>
165-
<TextBlock
166-
MaxWidth="60"
167-
Text="{Binding Enabled}"
168-
TextAlignment="Center" />
165+
<TextBlock TextAlignment="Left">
166+
<TextBlock.Style>
167+
<Style TargetType="TextBlock">
168+
<Setter Property="Text" Value="{DynamicResource flowlauncher_plugin_program_false}" />
169+
<Style.Triggers>
170+
<DataTrigger Binding="{Binding Enabled, UpdateSourceTrigger=PropertyChanged}" Value="True">
171+
<Setter Property="Text" Value="{DynamicResource flowlauncher_plugin_program_true}" />
172+
</DataTrigger>
173+
</Style.Triggers>
174+
</Style>
175+
</TextBlock.Style>
176+
</TextBlock>
169177
</DataTemplate>
170178
</GridViewColumn.CellTemplate>
171179
</GridViewColumn>
172-
<GridViewColumn Width="550" Header="{DynamicResource flowlauncher_plugin_program_location}">
180+
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_program_location}">
173181
<GridViewColumn.CellTemplate>
174182
<DataTemplate>
175-
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}" />
183+
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}" TextTrimming="CharacterEllipsis" />
176184
</DataTemplate>
177185
</GridViewColumn.CellTemplate>
178186
</GridViewColumn>
@@ -182,7 +190,7 @@
182190
<DockPanel
183191
Grid.Row="3"
184192
Grid.RowSpan="1"
185-
Margin="0,0,20,10">
193+
Margin="0,0,20,0">
186194
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
187195
<Button
188196
x:Name="btnProgramSourceStatus"

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Flow.Launcher.Plugin.Program.Programs;
1010
using System.ComponentModel;
1111
using System.Windows.Data;
12+
using System;
1213

1314
namespace Flow.Launcher.Plugin.Program.Views
1415
{
@@ -383,5 +384,20 @@ private bool IsAllItemsUserAdded(List<ProgramSource> items)
383384
{
384385
return items.All(x => _settings.ProgramSources.Any(y => y.UniqueIdentifier == x.UniqueIdentifier));
385386
}
387+
388+
private void ListView_SizeChanged(object sender, SizeChangedEventArgs e)
389+
{
390+
ListView listView = sender as ListView;
391+
GridView gView = listView.View as GridView;
392+
393+
var workingWidth = listView.ActualWidth - SystemParameters.VerticalScrollBarWidth; // take into account vertical scrollbar
394+
var col1 = 0.25;
395+
var col2 = 0.15;
396+
var col3 = 0.60;
397+
398+
gView.Columns[0].Width = workingWidth * col1;
399+
gView.Columns[1].Width = workingWidth * col2;
400+
gView.Columns[2].Width = workingWidth * col3;
401+
}
386402
}
387403
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
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_true">Enabled</system:String>
16+
<system:String x:Key="flowlauncher_plugin_websearch_false">Disabled</system:String>
1517
<system:String x:Key="flowlauncher_plugin_websearch_confirm">Confirm</system:String>
1618
<system:String x:Key="flowlauncher_plugin_websearch_action_keyword">Action Keyword</system:String>
1719
<system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String>
@@ -32,7 +34,7 @@
3234

3335
<!-- web search edit -->
3436
<system:String x:Key="flowlauncher_plugin_websearch_title">Title</system:String>
35-
<system:String x:Key="flowlauncher_plugin_websearch_enable">Enable</system:String>
37+
<system:String x:Key="flowlauncher_plugin_websearch_enable">Status</system:String>
3638
<system:String x:Key="flowlauncher_plugin_websearch_select_icon">Select Icon</system:String>
3739
<system:String x:Key="flowlauncher_plugin_websearch_icon">Icon</system:String>
3840
<system:String x:Key="flowlauncher_plugin_websearch_cancel">Cancel</system:String>

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</DockPanel>
3636
</DataTemplate>
3737
</UserControl.Resources>
38-
<Grid Margin="14,14,14,0">
38+
<Grid Margin="0,4,0,0">
3939
<Grid.RowDefinitions>
4040
<RowDefinition />
4141
<RowDefinition Height="56" />
@@ -44,7 +44,7 @@
4444
<ListView
4545
x:Name="SearchSourcesListView"
4646
Grid.Row="0"
47-
Margin="0,18,0,0"
47+
Margin="18,18,18,0"
4848
BorderBrush="DarkGray"
4949
BorderThickness="1"
5050
GridViewColumnHeader.Click="SortByColumn"
@@ -86,13 +86,21 @@
8686
</DataTemplate>
8787
</GridViewColumn.CellTemplate>
8888
</GridViewColumn>
89-
<GridViewColumn
90-
Width="80"
91-
DisplayMemberBinding="{Binding Enabled}"
92-
Header="{DynamicResource flowlauncher_plugin_websearch_enable}">
89+
<GridViewColumn Width="140" Header="{DynamicResource flowlauncher_plugin_websearch_enable}">
9390
<GridViewColumn.CellTemplate>
9491
<DataTemplate>
95-
<TextBlock Text="{Binding Enabled}" />
92+
<TextBlock>
93+
<TextBlock.Style>
94+
<Style TargetType="TextBlock">
95+
<Setter Property="Text" Value="{DynamicResource flowlauncher_plugin_websearch_false}" />
96+
<Style.Triggers>
97+
<DataTrigger Binding="{Binding Enabled, UpdateSourceTrigger=PropertyChanged}" Value="True">
98+
<Setter Property="Text" Value="{DynamicResource flowlauncher_plugin_websearch_true}" />
99+
</DataTrigger>
100+
</Style.Triggers>
101+
</Style>
102+
</TextBlock.Style>
103+
</TextBlock>
96104
</DataTemplate>
97105
</GridViewColumn.CellTemplate>
98106
</GridViewColumn>
@@ -115,17 +123,17 @@
115123
Content="{DynamicResource flowlauncher_plugin_websearch_edit}" />
116124
<Button
117125
Width="100"
118-
Margin="10,10,0,10"
126+
Margin="10,10,18,10"
119127
Click="OnAddSearchSearchClick"
120128
Content="{DynamicResource flowlauncher_plugin_websearch_add}" />
121129
</StackPanel>
122130
<Border
123131
Grid.Row="2"
124132
Margin="0,0,0,0"
125133
HorizontalAlignment="Stretch"
126-
BorderBrush="#cecece"
134+
BorderBrush="{DynamicResource Color03B}"
127135
BorderThickness="0,1,0,0">
128-
<DockPanel Margin="0,14,0,0" HorizontalAlignment="Right">
136+
<DockPanel HorizontalAlignment="Right">
129137
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
130138
<Label
131139
Margin="14,0,10,0"
@@ -147,7 +155,7 @@
147155
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}" />
148156
<CheckBox
149157
Name="EnableSuggestion"
150-
Margin="0,0,0,0"
158+
Margin="0,0,8,0"
151159
IsChecked="{Binding Settings.EnableSuggestion}" />
152160
</StackPanel>
153161
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working -->

0 commit comments

Comments
 (0)