Skip to content

Commit ddda425

Browse files
authored
Merge pull request #779 from onesounds/AdjustWebsearchPlugin
Adjust websearch plugin & Small Fix for pluginstore PR & Setting Popup Redesign
2 parents 6ad49c5 + c2a6330 commit ddda425

16 files changed

+300
-182
lines changed

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>
@@ -145,10 +147,11 @@
145147
<system:String x:Key="newActionKeywordsHasBeenAssigned">This new Action Keyword is already assigned to another plugin, please choose a different one</system:String>
146148
<system:String x:Key="success">Success</system:String>
147149
<system:String x:Key="completedSuccessfully">Completed successfully</system:String>
148-
<system:String x:Key="actionkeyword_tips">Use * if you don't want to specify an action keyword</system:String>
150+
<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>
149151

150152
<!--Custom Query Hotkey Dialog-->
151-
<system:String x:Key="customeQueryHotkeyTitle">Custom Plugin Hotkey</system:String>
153+
<system:String x:Key="customeQueryHotkeyTitle">Custom Query Hotkey</system:String>
154+
<system:String x:Key="customeQueryHotkeyTips">Press the custom hotkey to automatically insert the specified query.</system:String>
152155
<system:String x:Key="preview">Preview</system:String>
153156
<system:String x:Key="hotkeyIsNotUnavailable">Hotkey is unavailable, please select a new hotkey</system:String>
154157
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>

Flow.Launcher/PriorityChangeWindow.xaml

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,45 @@
66
xmlns:local="clr-namespace:Flow.Launcher"
77
Loaded="PriorityChangeWindow_Loaded"
88
mc:Ignorable="d"
9+
ResizeMode="NoResize"
910
WindowStartupLocation="CenterScreen"
10-
Title="{DynamicResource changePriorityWindow}" Height="400" Width="350" ResizeMode="NoResize" Background="#f3f3f3">
11+
Title="{DynamicResource changePriorityWindow}" Height="365" Width="350" Background="#F3F3F3" BorderBrush="#cecece">
1112
<Grid>
1213
<Grid.RowDefinitions>
13-
<RowDefinition />
14-
<RowDefinition />
1514
<RowDefinition />
1615
<RowDefinition Height="80"/>
1716
</Grid.RowDefinitions>
18-
<Grid.ColumnDefinitions>
19-
<ColumnDefinition />
20-
</Grid.ColumnDefinitions>
21-
<StackPanel Grid.Row="0" VerticalAlignment="Center">
22-
<TextBlock Grid.Column="0" FontFamily="/Resources/#Segoe Fluent Icons" FontSize="40" TextAlignment="Center"
23-
Margin="0 0 0 0">
24-
&#xe8d0;
25-
</TextBlock>
26-
</StackPanel>
27-
28-
<Border Background="#ffffff" Grid.Row="1" BorderBrush="#cecece" BorderThickness="1" Margin="14 0 14 0" Padding="0 14 0 0" CornerRadius="5">
29-
<StackPanel Orientation="Vertical" >
30-
31-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
32-
<TextBlock FontSize="14" Grid.Column="1" VerticalAlignment="Center"
17+
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
18+
<Grid>
19+
<StackPanel>
20+
<StackPanel Grid.Row="0" Margin="0 0 0 12">
21+
<TextBlock Grid.Column="0" Text="{DynamicResource changePriorityWindow}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
22+
Margin="0 0 0 0" />
23+
</StackPanel>
24+
<StackPanel>
25+
<TextBlock
26+
Text="{DynamicResource priority_tips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
27+
</StackPanel>
28+
29+
<StackPanel Orientation="Horizontal" Margin="0 28 0 0">
30+
<TextBlock FontSize="14" Grid.Column="1" VerticalAlignment="Center"
3331
HorizontalAlignment="Left" Text="{DynamicResource currentPriority}" />
34-
<TextBlock x:Name="OldPriority" Grid.Row="0" Grid.Column="1" Margin="14 0 10 0" FontSize="14"
32+
<TextBlock x:Name="OldPriority" Grid.Row="0" Grid.Column="1" Margin="10 0 10 0" FontSize="14"
3533
VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" />
36-
</StackPanel>
34+
</StackPanel>
3735

38-
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center">
39-
<TextBlock FontSize="14" VerticalAlignment="Center"
36+
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
37+
<TextBlock FontSize="14" VerticalAlignment="Center"
4038
HorizontalAlignment="Right" Text="{DynamicResource newPriority}" />
41-
<TextBox x:Name="tbAction" Margin="14 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
42-
</StackPanel>
43-
44-
</StackPanel>
39+
<TextBox x:Name="tbAction" Margin="10 0 15 0" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
40+
</StackPanel>
41+
</StackPanel>
42+
</Grid>
4543
</Border>
46-
<StackPanel Grid.Row="2" VerticalAlignment="Center">
47-
<TextBlock Foreground="Gray"
48-
Text="{DynamicResource priority_tips}" TextWrapping="WrapWithOverflow" TextAlignment="Center"
49-
Margin="20,0,20,0"/>
50-
</StackPanel>
51-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="3" Grid.Column="1">
52-
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="0 0 10 0" Width="80" Height="30"
44+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
45+
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="0 0 5 0" Width="100" Height="30"
5346
Content="{DynamicResource cancel}" />
54-
<Button x:Name="btnDone" Margin="10 0 0 0" Width="80" Height="30" Click="btnDone_OnClick">
47+
<Button x:Name="btnDone" Margin="5 0 0 0" Width="100" Height="30" Click="btnDone_OnClick">
5548
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
5649
</Button>
5750
</StackPanel>

Flow.Launcher/SettingWindow.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
Height="700" Width="1000"
2020
MinWidth="900"
2121
MinHeight="600"
22+
MouseDown="window_MouseDown"
2223
Loaded="OnLoaded"
2324
Closed="OnClosed"
2425
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}">
@@ -645,6 +646,7 @@
645646
</Border>
646647
<Border Grid.Column="0" Grid.Row="1" Background="#f3f3f3" Padding="0 0 0 0">
647648
<ListBox SelectedItem="{Binding SelectedPlugin}"
649+
ScrollViewer.CanContentScroll="False"
648650
ItemsSource="{Binding PluginViewModels}"
649651
Margin="5, 0, 0, 0" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
650652
ItemContainerStyle="{StaticResource PluginList}"
@@ -1176,7 +1178,7 @@
11761178
<TextBlock DockPanel.Dock="Top" Margin="10" HorizontalAlignment="Right">
11771179
<Hyperlink NavigateUri="{Binding Theme, Mode=OneWay}"
11781180
RequestNavigate="OnRequestNavigate">
1179-
<Run Text="{DynamicResource browserMoreThemes}" />
1181+
<Run Text="{DynamicResource howToCreateTheme}" />
11801182
</Hyperlink>
11811183
</TextBlock>
11821184
</Border>
@@ -1582,4 +1584,4 @@
15821584
</Border>
15831585
</TabItem>
15841586
</TabControl>
1585-
</Window>
1587+
</Window>

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,5 +281,15 @@ private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
281281
API.ShowMainWindow();
282282
}
283283
}
284+
285+
private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */
286+
{
287+
TextBox textBox = Keyboard.FocusedElement as TextBox;
288+
if (textBox != null)
289+
{
290+
TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next);
291+
textBox.MoveFocus(tRequest);
292+
}
293+
}
284294
}
285295
}

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public async Task RefreshExternalPluginsAsync()
272272

273273
#region theme
274274

275-
public static string Theme => @"http://www.wox.one/theme/builder";
275+
public static string Theme => @"https://flow-launcher.github.io/docs/#/how-to-create-a-theme";
276276

277277
public string SelectedTheme
278278
{
1.5 KB
Loading

0 commit comments

Comments
 (0)