Skip to content

Commit de7c462

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into FileManager
2 parents 6f004a4 + 74aa9e4 commit de7c462

File tree

24 files changed

+381
-225
lines changed

24 files changed

+381
-225
lines changed

Flow.Launcher.Core/Resource/Internationalization.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Flow.Launcher.Infrastructure.Logger;
1010
using Flow.Launcher.Infrastructure.UserSettings;
1111
using Flow.Launcher.Plugin;
12+
using System.Globalization;
1213

1314
namespace Flow.Launcher.Core.Resource
1415
{
@@ -96,7 +97,8 @@ public void ChangeLanguage(Language language)
9697
}
9798
UpdatePluginMetadataTranslations();
9899
Settings.Language = language.LanguageCode;
99-
100+
CultureInfo.CurrentCulture = new CultureInfo(language.LanguageCode);
101+
CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture;
100102
}
101103

102104
public bool PromptShouldUsePinyin(string languageCodeToSet)

Flow.Launcher/ActionKeywords.xaml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,54 @@
11
<Window x:Class="Flow.Launcher.ActionKeywords"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
Title="ActionKeywords"
4+
Title="{DynamicResource actionKeywordsTitle}"
55
Icon="Images\app.png"
66
ResizeMode="NoResize"
77
Loaded="ActionKeyword_OnLoaded"
88
WindowStartupLocation="CenterScreen"
9-
Height="250" Width="500">
9+
Height="365" Width="450" Background="#F3F3F3" BorderBrush="#cecece">
1010
<Grid>
11+
<Grid.RowDefinitions>
12+
<RowDefinition />
13+
<RowDefinition Height="80"/>
14+
</Grid.RowDefinitions>
15+
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
16+
<Grid>
17+
<StackPanel>
18+
<StackPanel Grid.Row="0" Margin="0 0 0 12">
19+
<TextBlock Grid.Column="0" Text="{DynamicResource actionKeywordsTitle}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
20+
Margin="0 0 0 0" />
21+
</StackPanel>
22+
<StackPanel>
23+
<TextBlock
24+
Text="{DynamicResource actionkeyword_tips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
25+
</StackPanel>
26+
27+
<StackPanel Orientation="Horizontal" Margin="0 18 0 0">
28+
<TextBlock FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"
29+
HorizontalAlignment="Left" Text="{DynamicResource currentActionKeywords}" />
30+
<TextBlock x:Name="tbOldActionKeyword" Grid.Row="0" Grid.Column="1" Margin="14 10 10 10" FontSize="14"
31+
VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="SemiBold"/>
32+
</StackPanel>
33+
<StackPanel Orientation="Horizontal">
34+
<TextBlock FontSize="14" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"
35+
HorizontalAlignment="Left" Text="{DynamicResource newActionKeyword}" />
36+
37+
<TextBox x:Name="tbAction" Margin="10 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
38+
39+
</StackPanel>
40+
</StackPanel>
41+
</Grid>
42+
</Border>
43+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
44+
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 5 0" Width="100" Height="30"
45+
Content="{DynamicResource cancel}" />
46+
<Button x:Name="btnDone" Margin="5 0 10 0" Width="100" Height="30" Click="btnDone_OnClick">
47+
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
48+
</Button>
49+
</StackPanel>
50+
</Grid>
51+
<!--
1152
<Grid.RowDefinitions>
1253
<RowDefinition />
1354
<RowDefinition Height="60"/>
@@ -40,4 +81,5 @@
4081
</Button>
4182
</StackPanel>
4283
</Grid>
84+
-->
4385
</Window>

Flow.Launcher/CustomQueryHotkeySetting.xaml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
Icon="Images\app.png"
66
ResizeMode="NoResize"
77
WindowStartupLocation="CenterScreen"
8-
Title="{DynamicResource customeQueryHotkeyTitle}" Height="200" Width="674.766">
8+
MouseDown="window_MouseDown"
9+
Title="{DynamicResource customeQueryHotkeyTitle}" Height="345" Width="500" Background="#F3F3F3" BorderBrush="#cecece">
910
<Window.InputBindings>
1011
<KeyBinding Key="Escape" Command="Close"/>
1112
</Window.InputBindings>
@@ -15,29 +16,42 @@
1516
<Grid>
1617
<Grid.RowDefinitions>
1718
<RowDefinition />
18-
<RowDefinition />
19-
<RowDefinition />
19+
<RowDefinition Height="80"/>
2020
</Grid.RowDefinitions>
21-
<Grid.ColumnDefinitions>
22-
<ColumnDefinition Width="150" />
23-
<ColumnDefinition />
24-
</Grid.ColumnDefinitions>
25-
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
26-
HorizontalAlignment="Right" Text="{DynamicResource hotkey}" />
27-
<flowlauncher:HotkeyControl x:Name="ctlHotkey" Margin="10,0,10,0" Grid.Column="1" VerticalAlignment="Center" Height="32" />
21+
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
22+
<Grid>
23+
<StackPanel>
24+
<StackPanel Grid.Row="0" Margin="0 0 0 12">
25+
<TextBlock Grid.Column="0" Text="{DynamicResource customeQueryHotkeyTitle}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
26+
Margin="0 0 0 0" />
27+
</StackPanel>
28+
<StackPanel>
29+
<TextBlock
30+
Text="{DynamicResource customeQueryHotkeyTips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
31+
</StackPanel>
2832

29-
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
30-
HorizontalAlignment="Right" Text="{DynamicResource actionKeyword}" />
31-
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1">
32-
<TextBox x:Name="tbAction" Margin="10" Width="400" VerticalAlignment="Center" HorizontalAlignment="Left" />
33-
<Button x:Name="btnTestActionKeyword" Padding="10 5 10 5" Height="30" Click="BtnTestActionKeyword_OnClick"
34-
Content="{DynamicResource preview}" />
35-
</StackPanel>
33+
<StackPanel Orientation="Horizontal" Margin="0 20 0 0">
34+
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
35+
HorizontalAlignment="Left" Text="{DynamicResource hotkey}" Width="60"/>
36+
<flowlauncher:HotkeyControl x:Name="ctlHotkey" Margin="10,0,10,0" Grid.Column="1" VerticalAlignment="Center" Height="32" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Width="200"/>
37+
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
38+
HorizontalAlignment="Left" Text="{DynamicResource actionKeyword}" />
39+
</StackPanel>
3640

37-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="1">
38-
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="32"
41+
<StackPanel Orientation="Horizontal" Margin="0 0 0 0">
42+
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Width="60"
43+
HorizontalAlignment="Left" Text="{DynamicResource customQuery}" />
44+
<TextBox x:Name="tbAction" Margin="10" Width="250" VerticalAlignment="Center" HorizontalAlignment="Left" />
45+
<Button x:Name="btnTestActionKeyword" Padding="10 5 10 5" Height="30" Click="BtnTestActionKeyword_OnClick"
46+
Content="{DynamicResource preview}" />
47+
</StackPanel>
48+
</StackPanel>
49+
</Grid>
50+
</Border>
51+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
52+
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 5 0" Width="100" Height="32"
3953
Content="{DynamicResource cancel}" />
40-
<Button x:Name="btnAdd" Margin="10 0 10 0" Width="80" Height="32" Click="btnAdd_OnClick">
54+
<Button x:Name="btnAdd" Margin="5 0 10 0" Width="100" Height="32" Click="btnAdd_OnClick">
4155
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
4256
</Button>
4357
</StackPanel>

Flow.Launcher/CustomQueryHotkeySetting.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Linq;
88
using System.Windows;
99
using System.Windows.Input;
10+
using System.Windows.Controls;
1011

1112
namespace Flow.Launcher
1213
{
@@ -99,5 +100,15 @@ private void cmdEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
99100
{
100101
Close();
101102
}
103+
104+
private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */
105+
{
106+
TextBox textBox = Keyboard.FocusedElement as TextBox;
107+
if (textBox != null)
108+
{
109+
TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next);
110+
textBox.MoveFocus(tRequest);
111+
}
112+
}
102113
}
103114
}

Flow.Launcher/HotkeyControl.xaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99
d:DesignHeight="300" d:DesignWidth="300">
1010
<Grid>
1111
<Grid.ColumnDefinitions>
12-
<ColumnDefinition Width="125" />
13-
<ColumnDefinition Width="160" />
12+
<ColumnDefinition Width="200"/>
1413
</Grid.ColumnDefinitions>
15-
<TextBlock x:Name="tbMsg" Visibility="Hidden" Margin="8 0 0 0" VerticalAlignment="Center" Grid.Column="0" HorizontalAlignment="Right"/>
16-
<TextBox x:Name="tbHotkey" TabIndex="100" VerticalContentAlignment="Center" Grid.Column="1"
17-
PreviewKeyDown="TbHotkey_OnPreviewKeyDown" input:InputMethod.IsInputMethodEnabled="False" Margin="5 0 18 0"/>
14+
<Popup x:Name="popup" AllowDrop="True" PopupAnimation="Fade" PlacementTarget="{Binding ElementName=tbHotkey}" IsOpen="{Binding IsKeyboardFocused, ElementName=tbHotkey, Mode=OneWay}" StaysOpen="True" AllowsTransparency="True" Placement="Top" VerticalOffset="-5">
15+
<Border Background="#f6f6f6" BorderBrush="#cecece" BorderThickness="1" CornerRadius="6" Width="120" Height="30">
16+
<TextBlock x:Name="tbMsg" FontSize="13" FontWeight="SemiBold" Visibility="Visible" Margin="0 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center">
17+
press key
18+
</TextBlock>
19+
</Border>
20+
</Popup>
21+
22+
<TextBox x:Name="tbHotkey" TabIndex="100" VerticalContentAlignment="Center"
23+
PreviewKeyDown="TbHotkey_OnPreviewKeyDown" input:InputMethod.IsInputMethodEnabled="False" Margin="0 0 18 0">
24+
</TextBox>
1825
</Grid>
1926
</UserControl>

Flow.Launcher/Languages/en.xaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<system:String x:Key="browserMorePlugins">Find more plugins</system:String>
5050
<system:String x:Key="enable">On</system:String>
5151
<system:String x:Key="disable">Off</system:String>
52+
<system:String x:Key="actionKeywordsTitle">Action keyword Setting</system:String>
5253
<system:String x:Key="actionKeywords">Action keyword</system:String>
5354
<system:String x:Key="currentActionKeywords">Current action keyword:</system:String>
5455
<system:String x:Key="newActionKeyword">New action keyword:</system:String>
@@ -68,7 +69,8 @@
6869

6970
<!--Setting Theme-->
7071
<system:String x:Key="theme">Theme</system:String>
71-
<system:String x:Key="browserMoreThemes">Browse for more themes</system:String>
72+
<system:String x:Key="browserMoreThemes">Theme Gallery</system:String>
73+
<system:String x:Key="howToCreateTheme">How to create a theme</system:String>
7274
<system:String x:Key="hiThere">Hi There</system:String>
7375
<system:String x:Key="queryBoxFont">Query Box Font</system:String>
7476
<system:String x:Key="resultItemFont">Result Item Font</system:String>
@@ -153,10 +155,11 @@
153155
<system:String x:Key="newActionKeywordsHasBeenAssigned">This new Action Keyword is already assigned to another plugin, please choose a different one</system:String>
154156
<system:String x:Key="success">Success</system:String>
155157
<system:String x:Key="completedSuccessfully">Completed successfully</system:String>
156-
<system:String x:Key="actionkeyword_tips">Use * if you don't want to specify an action keyword</system:String>
158+
<system:String x:Key="actionkeyword_tips">Enter the action keyword you need to start the plug-in. Use * if you don't want to specify an action keyword. In the case, The plug-in works without keywords. </system:String>
157159

158160
<!--Custom Query Hotkey Dialog-->
159-
<system:String x:Key="customeQueryHotkeyTitle">Custom Plugin Hotkey</system:String>
161+
<system:String x:Key="customeQueryHotkeyTitle">Custom Query Hotkey</system:String>
162+
<system:String x:Key="customeQueryHotkeyTips">Press the custom hotkey to automatically insert the specified query.</system:String>
160163
<system:String x:Key="preview">Preview</system:String>
161164
<system:String x:Key="hotkeyIsNotUnavailable">Hotkey is unavailable, please select a new hotkey</system:String>
162165
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>

0 commit comments

Comments
 (0)