Skip to content

Adjust websearch plugin & Small Fix for pluginstore PR & Setting Popup Redesign #779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 2, 2021
Merged
46 changes: 44 additions & 2 deletions Flow.Launcher/ActionKeywords.xaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,54 @@
<Window x:Class="Flow.Launcher.ActionKeywords"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="ActionKeywords"
Title="{DynamicResource actionKeywordsTitle}"
Icon="Images\app.png"
ResizeMode="NoResize"
Loaded="ActionKeyword_OnLoaded"
WindowStartupLocation="CenterScreen"
Height="250" Width="500">
Height="365" Width="450" Background="#F3F3F3" BorderBrush="#cecece">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
<Grid>
<StackPanel>
<StackPanel Grid.Row="0" Margin="0 0 0 12">
<TextBlock Grid.Column="0" Text="{DynamicResource actionKeywordsTitle}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
Margin="0 0 0 0" />
</StackPanel>
<StackPanel>
<TextBlock
Text="{DynamicResource actionkeyword_tips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="0 18 0 0">
<TextBlock FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"
HorizontalAlignment="Left" Text="{DynamicResource currentActionKeywords}" />
<TextBlock x:Name="tbOldActionKeyword" Grid.Row="0" Grid.Column="1" Margin="14 10 10 10" FontSize="14"
VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="SemiBold"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="14" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"
HorizontalAlignment="Left" Text="{DynamicResource newActionKeyword}" />

<TextBox x:Name="tbAction" Margin="10 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />

</StackPanel>
</StackPanel>
</Grid>
</Border>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 5 0" Width="100" Height="30"
Content="{DynamicResource cancel}" />
<Button x:Name="btnDone" Margin="5 0 10 0" Width="100" Height="30" Click="btnDone_OnClick">
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
</Button>
</StackPanel>
</Grid>
<!--
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="60"/>
Expand Down Expand Up @@ -40,4 +81,5 @@
</Button>
</StackPanel>
</Grid>
-->
</Window>
54 changes: 34 additions & 20 deletions Flow.Launcher/CustomQueryHotkeySetting.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
Icon="Images\app.png"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
Title="{DynamicResource customeQueryHotkeyTitle}" Height="200" Width="674.766">
MouseDown="window_MouseDown"
Title="{DynamicResource customeQueryHotkeyTitle}" Height="345" Width="500" Background="#F3F3F3" BorderBrush="#cecece">
<Window.InputBindings>
<KeyBinding Key="Escape" Command="Close"/>
</Window.InputBindings>
Expand All @@ -15,29 +16,42 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
HorizontalAlignment="Right" Text="{DynamicResource hotkey}" />
<flowlauncher:HotkeyControl x:Name="ctlHotkey" Margin="10,0,10,0" Grid.Column="1" VerticalAlignment="Center" Height="32" />
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
<Grid>
<StackPanel>
<StackPanel Grid.Row="0" Margin="0 0 0 12">
<TextBlock Grid.Column="0" Text="{DynamicResource customeQueryHotkeyTitle}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
Margin="0 0 0 0" />
</StackPanel>
<StackPanel>
<TextBlock
Text="{DynamicResource customeQueryHotkeyTips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
</StackPanel>

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

<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="1">
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="32"
<StackPanel Orientation="Horizontal" Margin="0 0 0 0">
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Width="60"
HorizontalAlignment="Left" Text="{DynamicResource customQuery}" />
<TextBox x:Name="tbAction" Margin="10" Width="250" VerticalAlignment="Center" HorizontalAlignment="Left" />
<Button x:Name="btnTestActionKeyword" Padding="10 5 10 5" Height="30" Click="BtnTestActionKeyword_OnClick"
Content="{DynamicResource preview}" />
</StackPanel>
</StackPanel>
</Grid>
</Border>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 5 0" Width="100" Height="32"
Content="{DynamicResource cancel}" />
<Button x:Name="btnAdd" Margin="10 0 10 0" Width="80" Height="32" Click="btnAdd_OnClick">
<Button x:Name="btnAdd" Margin="5 0 10 0" Width="100" Height="32" Click="btnAdd_OnClick">
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
</Button>
</StackPanel>
Expand Down
11 changes: 11 additions & 0 deletions Flow.Launcher/CustomQueryHotkeySetting.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Linq;
using System.Windows;
using System.Windows.Input;
using System.Windows.Controls;

namespace Flow.Launcher
{
Expand Down Expand Up @@ -99,5 +100,15 @@ private void cmdEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
{
Close();
}

private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */
{
TextBox textBox = Keyboard.FocusedElement as TextBox;
if (textBox != null)
{
TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next);
textBox.MoveFocus(tRequest);
}
}
}
}
17 changes: 12 additions & 5 deletions Flow.Launcher/HotkeyControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="125" />
<ColumnDefinition Width="160" />
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="tbMsg" Visibility="Hidden" Margin="8 0 0 0" VerticalAlignment="Center" Grid.Column="0" HorizontalAlignment="Right"/>
<TextBox x:Name="tbHotkey" TabIndex="100" VerticalContentAlignment="Center" Grid.Column="1"
PreviewKeyDown="TbHotkey_OnPreviewKeyDown" input:InputMethod.IsInputMethodEnabled="False" Margin="5 0 18 0"/>
<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">
<Border Background="#f6f6f6" BorderBrush="#cecece" BorderThickness="1" CornerRadius="6" Width="120" Height="30">
<TextBlock x:Name="tbMsg" FontSize="13" FontWeight="SemiBold" Visibility="Visible" Margin="0 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center">
press key
</TextBlock>
</Border>
</Popup>

<TextBox x:Name="tbHotkey" TabIndex="100" VerticalContentAlignment="Center"
PreviewKeyDown="TbHotkey_OnPreviewKeyDown" input:InputMethod.IsInputMethodEnabled="False" Margin="0 0 18 0">
</TextBox>
</Grid>
</UserControl>
9 changes: 6 additions & 3 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<system:String x:Key="browserMorePlugins">Find more plugins</system:String>
<system:String x:Key="enable">On</system:String>
<system:String x:Key="disable">Off</system:String>
<system:String x:Key="actionKeywordsTitle">Action keyword Setting</system:String>
<system:String x:Key="actionKeywords">Action keyword</system:String>
<system:String x:Key="currentActionKeywords">Current action keyword:</system:String>
<system:String x:Key="newActionKeyword">New action keyword:</system:String>
Expand All @@ -68,7 +69,8 @@

<!--Setting Theme-->
<system:String x:Key="theme">Theme</system:String>
<system:String x:Key="browserMoreThemes">Browse for more themes</system:String>
<system:String x:Key="browserMoreThemes">Theme Gallery</system:String>
<system:String x:Key="howToCreateTheme">How to create a theme</system:String>
<system:String x:Key="hiThere">Hi There</system:String>
<system:String x:Key="queryBoxFont">Query Box Font</system:String>
<system:String x:Key="resultItemFont">Result Item Font</system:String>
Expand Down Expand Up @@ -145,10 +147,11 @@
<system:String x:Key="newActionKeywordsHasBeenAssigned">This new Action Keyword is already assigned to another plugin, please choose a different one</system:String>
<system:String x:Key="success">Success</system:String>
<system:String x:Key="completedSuccessfully">Completed successfully</system:String>
<system:String x:Key="actionkeyword_tips">Use * if you don't want to specify an action keyword</system:String>
<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>

<!--Custom Query Hotkey Dialog-->
<system:String x:Key="customeQueryHotkeyTitle">Custom Plugin Hotkey</system:String>
<system:String x:Key="customeQueryHotkeyTitle">Custom Query Hotkey</system:String>
<system:String x:Key="customeQueryHotkeyTips">Press the custom hotkey to automatically insert the specified query.</system:String>
<system:String x:Key="preview">Preview</system:String>
<system:String x:Key="hotkeyIsNotUnavailable">Hotkey is unavailable, please select a new hotkey</system:String>
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>
Expand Down
61 changes: 27 additions & 34 deletions Flow.Launcher/PriorityChangeWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,45 @@
xmlns:local="clr-namespace:Flow.Launcher"
Loaded="PriorityChangeWindow_Loaded"
mc:Ignorable="d"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
Title="{DynamicResource changePriorityWindow}" Height="400" Width="350" ResizeMode="NoResize" Background="#f3f3f3">
Title="{DynamicResource changePriorityWindow}" Height="365" Width="350" Background="#F3F3F3" BorderBrush="#cecece">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" VerticalAlignment="Center">
<TextBlock Grid.Column="0" FontFamily="/Resources/#Segoe Fluent Icons" FontSize="40" TextAlignment="Center"
Margin="0 0 0 0">
&#xe8d0;
</TextBlock>
</StackPanel>

<Border Background="#ffffff" Grid.Row="1" BorderBrush="#cecece" BorderThickness="1" Margin="14 0 14 0" Padding="0 14 0 0" CornerRadius="5">
<StackPanel Orientation="Vertical" >

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
<TextBlock FontSize="14" Grid.Column="1" VerticalAlignment="Center"
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
<Grid>
<StackPanel>
<StackPanel Grid.Row="0" Margin="0 0 0 12">
<TextBlock Grid.Column="0" Text="{DynamicResource changePriorityWindow}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
Margin="0 0 0 0" />
</StackPanel>
<StackPanel>
<TextBlock
Text="{DynamicResource priority_tips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="0 28 0 0">
<TextBlock FontSize="14" Grid.Column="1" VerticalAlignment="Center"
HorizontalAlignment="Left" Text="{DynamicResource currentPriority}" />
<TextBlock x:Name="OldPriority" Grid.Row="0" Grid.Column="1" Margin="14 0 10 0" FontSize="14"
<TextBlock x:Name="OldPriority" Grid.Row="0" Grid.Column="1" Margin="10 0 10 0" FontSize="14"
VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" />
</StackPanel>
</StackPanel>

<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center">
<TextBlock FontSize="14" VerticalAlignment="Center"
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<TextBlock FontSize="14" VerticalAlignment="Center"
HorizontalAlignment="Right" Text="{DynamicResource newPriority}" />
<TextBox x:Name="tbAction" Margin="14 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>

</StackPanel>
<TextBox x:Name="tbAction" Margin="10 0 15 0" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>
</StackPanel>
</Grid>
</Border>
<StackPanel Grid.Row="2" VerticalAlignment="Center">
<TextBlock Foreground="Gray"
Text="{DynamicResource priority_tips}" TextWrapping="WrapWithOverflow" TextAlignment="Center"
Margin="20,0,20,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="3" Grid.Column="1">
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="0 0 10 0" Width="80" Height="30"
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="0 0 5 0" Width="100" Height="30"
Content="{DynamicResource cancel}" />
<Button x:Name="btnDone" Margin="10 0 0 0" Width="80" Height="30" Click="btnDone_OnClick">
<Button x:Name="btnDone" Margin="5 0 0 0" Width="100" Height="30" Click="btnDone_OnClick">
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
</Button>
</StackPanel>
Expand Down
6 changes: 4 additions & 2 deletions Flow.Launcher/SettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Height="700" Width="1000"
MinWidth="900"
MinHeight="600"
MouseDown="window_MouseDown"
Loaded="OnLoaded"
Closed="OnClosed"
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}">
Expand Down Expand Up @@ -645,6 +646,7 @@
</Border>
<Border Grid.Column="0" Grid.Row="1" Background="#f3f3f3" Padding="0 0 0 0">
<ListBox SelectedItem="{Binding SelectedPlugin}"
ScrollViewer.CanContentScroll="False"
ItemsSource="{Binding PluginViewModels}"
Margin="5, 0, 0, 0" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemContainerStyle="{StaticResource PluginList}"
Expand Down Expand Up @@ -1176,7 +1178,7 @@
<TextBlock DockPanel.Dock="Top" Margin="10" HorizontalAlignment="Right">
<Hyperlink NavigateUri="{Binding Theme, Mode=OneWay}"
RequestNavigate="OnRequestNavigate">
<Run Text="{DynamicResource browserMoreThemes}" />
<Run Text="{DynamicResource howToCreateTheme}" />
</Hyperlink>
</TextBlock>
</Border>
Expand Down Expand Up @@ -1582,4 +1584,4 @@
</Border>
</TabItem>
</TabControl>
</Window>
</Window>
10 changes: 10 additions & 0 deletions Flow.Launcher/SettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,15 @@ private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
API.ShowMainWindow();
}
}

private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */
{
TextBox textBox = Keyboard.FocusedElement as TextBox;
if (textBox != null)
{
TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next);
textBox.MoveFocus(tRequest);
}
}
}
}
2 changes: 1 addition & 1 deletion Flow.Launcher/ViewModel/SettingWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public async Task RefreshExternalPluginsAsync()

#region theme

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

public string SelectedTheme
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading