Skip to content

Commit 07aebae

Browse files
committed
Merge branch 'dev' into install-from-url
2 parents ea179e5 + 5e57d73 commit 07aebae

File tree

24 files changed

+720
-261
lines changed

24 files changed

+720
-261
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public CustomExplorerViewModel CustomExplorer
8282
}
8383
};
8484

85+
public bool UseAnimation { get; set; } = true;
86+
public bool UseSound { get; set; } = true;
8587

8688
/// <summary>
8789
/// when false Alphabet static service will always return empty results

Flow.Launcher/App.xaml.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
100100
AutoUpdates();
101101

102102
API.SaveAppAllSettings();
103-
104-
_mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible;
105103
Log.Info("|App.OnStartup|End Flow Launcher startup ---------------------------------------------------- ");
106104
});
107105
}
@@ -178,7 +176,7 @@ public void Dispose()
178176

179177
public void OnSecondAppStarted()
180178
{
181-
Current.MainWindow.Visibility = Visibility.Visible;
179+
Current.MainWindow.Show();
182180
}
183181
}
184182
}

Flow.Launcher/CustomQueryHotkeySetting.xaml

Lines changed: 103 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,126 @@
1-
<Window x:Class="Flow.Launcher.CustomQueryHotkeySetting"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
5-
Icon="Images\app.png"
6-
ResizeMode="NoResize"
7-
WindowStartupLocation="CenterScreen"
8-
MouseDown="window_MouseDown"
9-
Title="{DynamicResource customeQueryHotkeyTitle}" Height="345" Width="500" Background="#F3F3F3" BorderBrush="#cecece">
1+
<Window
2+
x:Class="Flow.Launcher.CustomQueryHotkeySetting"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
6+
Title="{DynamicResource customeQueryHotkeyTitle}"
7+
Width="500"
8+
Height="345"
9+
Background="#F3F3F3"
10+
BorderBrush="#cecece"
11+
Icon="Images\app.png"
12+
MouseDown="window_MouseDown"
13+
ResizeMode="NoResize"
14+
WindowStartupLocation="CenterScreen">
1015
<Window.InputBindings>
11-
<KeyBinding Key="Escape" Command="Close"/>
16+
<KeyBinding Key="Escape" Command="Close" />
1217
</Window.InputBindings>
1318
<Window.CommandBindings>
14-
<CommandBinding Command="Close" Executed="cmdEsc_OnPress"/>
19+
<CommandBinding Command="Close" Executed="cmdEsc_OnPress" />
1520
</Window.CommandBindings>
1621
<Grid>
1722
<Grid.RowDefinitions>
1823
<RowDefinition />
19-
<RowDefinition Height="80"/>
24+
<RowDefinition Height="80" />
2025
</Grid.RowDefinitions>
21-
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
26+
<Border
27+
Padding="26,26,26,0"
28+
Background="#ffffff"
29+
BorderBrush="#e5e5e5"
30+
BorderThickness="0,0,0,1">
2231
<Grid>
2332
<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" />
33+
<StackPanel Grid.Row="0" Margin="0,0,0,12">
34+
<TextBlock
35+
Grid.Column="0"
36+
Margin="0,0,0,0"
37+
FontFamily="Segoe UI"
38+
FontSize="20"
39+
FontWeight="SemiBold"
40+
Text="{DynamicResource customeQueryHotkeyTitle}"
41+
TextAlignment="Left" />
2742
</StackPanel>
2843
<StackPanel>
29-
<TextBlock
30-
Text="{DynamicResource customeQueryHotkeyTips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
44+
<TextBlock
45+
FontSize="14"
46+
Foreground="#1b1b1b"
47+
Text="{DynamicResource customeQueryHotkeyTips}"
48+
TextAlignment="Left"
49+
TextWrapping="WrapWithOverflow" />
3150
</StackPanel>
3251

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}" />
52+
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
53+
<TextBlock
54+
Grid.Row="0"
55+
Grid.Column="0"
56+
Width="60"
57+
Margin="10"
58+
HorizontalAlignment="Left"
59+
VerticalAlignment="Center"
60+
FontSize="14"
61+
Text="{DynamicResource hotkey}" />
62+
<flowlauncher:HotkeyControl
63+
x:Name="ctlHotkey"
64+
Grid.Column="1"
65+
Width="200"
66+
Height="32"
67+
Margin="10,0,10,0"
68+
HorizontalAlignment="Left"
69+
VerticalAlignment="Center"
70+
HorizontalContentAlignment="Left" />
71+
<TextBlock
72+
Grid.Row="1"
73+
Grid.Column="0"
74+
Margin="10"
75+
HorizontalAlignment="Left"
76+
VerticalAlignment="Center"
77+
FontSize="14"
78+
Text="{DynamicResource actionKeyword}" />
3979
</StackPanel>
4080

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}" />
81+
<StackPanel Margin="0,0,0,0" Orientation="Horizontal">
82+
<TextBlock
83+
Grid.Row="0"
84+
Grid.Column="0"
85+
Width="60"
86+
Margin="10"
87+
HorizontalAlignment="Left"
88+
VerticalAlignment="Center"
89+
FontSize="14"
90+
Text="{DynamicResource customQuery}" />
91+
<TextBox
92+
x:Name="tbAction"
93+
Width="250"
94+
Margin="10"
95+
HorizontalAlignment="Left"
96+
VerticalAlignment="Center" />
97+
<Button
98+
x:Name="btnTestActionKeyword"
99+
Height="30"
100+
Padding="10,5,10,5"
101+
Click="BtnTestActionKeyword_OnClick"
102+
Content="{DynamicResource preview}" />
47103
</StackPanel>
48104
</StackPanel>
49105
</Grid>
50106
</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"
53-
Content="{DynamicResource cancel}" />
54-
<Button x:Name="btnAdd" Margin="5 0 10 0" Width="100" Height="32" Click="btnAdd_OnClick">
107+
<StackPanel
108+
Grid.Row="1"
109+
HorizontalAlignment="Center"
110+
Orientation="Horizontal">
111+
<Button
112+
x:Name="btnCancel"
113+
Width="100"
114+
Height="32"
115+
Margin="10,0,5,0"
116+
Click="BtnCancel_OnClick"
117+
Content="{DynamicResource cancel}" />
118+
<Button
119+
x:Name="btnAdd"
120+
Width="100"
121+
Height="32"
122+
Margin="5,0,10,0"
123+
Click="btnAdd_OnClick">
55124
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
56125
</Button>
57126
</StackPanel>

Flow.Launcher/CustomQueryHotkeySetting.xaml.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using Flow.Launcher.Core.Resource;
22
using Flow.Launcher.Helper;
3-
using Flow.Launcher.Infrastructure.Hotkey;
43
using Flow.Launcher.Infrastructure.UserSettings;
5-
using System;
64
using System.Collections.ObjectModel;
75
using System.Linq;
86
using System.Windows;
@@ -91,9 +89,9 @@ public void UpdateItem(CustomPluginHotkey item)
9189
private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e)
9290
{
9391
App.API.ChangeQuery(tbAction.Text);
94-
Application.Current.MainWindow.Visibility = Visibility.Visible;
92+
Application.Current.MainWindow.Show();
93+
Application.Current.MainWindow.Opacity = 1;
9594
Application.Current.MainWindow.Focus();
96-
9795
}
9896

9997
private void cmdEsc_OnPress(object sender, ExecutedRoutedEventArgs e)

Flow.Launcher/Flow.Launcher.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@
104104
<ProjectReference Include="..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
105105
</ItemGroup>
106106

107+
<ItemGroup>
108+
<Content Include="Resources\open.wav">
109+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
110+
</Content>
111+
</ItemGroup>
112+
107113
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
108114
<Exec Command="taskkill /f /fi &quot;IMAGENAME eq Flow.Launcher.exe&quot;" />
109115
</Target>

Flow.Launcher/Helper/HotKeyMapper.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Flow.Launcher.Core.Resource;
77
using System.Windows;
88
using Flow.Launcher.ViewModel;
9-
using System.Threading.Tasks;
10-
using System.Threading;
119

1210
namespace Flow.Launcher.Helper
1311
{
@@ -27,7 +25,8 @@ internal static void Initialize(MainViewModel mainVM)
2725

2826
internal static void OnToggleHotkey(object sender, HotkeyEventArgs args)
2927
{
30-
mainViewModel.ToggleFlowLauncher();
28+
if (!mainViewModel.GameModeStatus)
29+
mainViewModel.ToggleFlowLauncher();
3130
}
3231

3332
private static void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
@@ -75,10 +74,10 @@ internal static void SetCustomQueryHotkey(CustomPluginHotkey hotkey)
7574
{
7675
SetHotkey(hotkey.Hotkey, (s, e) =>
7776
{
78-
if (mainViewModel.ShouldIgnoreHotkeys())
77+
if (mainViewModel.ShouldIgnoreHotkeys() || mainViewModel.GameModeStatus)
7978
return;
8079

81-
mainViewModel.MainWindowVisibility = Visibility.Visible;
80+
mainViewModel.Show();
8281
mainViewModel.ChangeQueryText(hotkey.ActionKeyword, true);
8382
});
8483
}

Flow.Launcher/Helper/SingletonWindowOpener.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public static T Open<T>(params object[] args) where T : Window
1010
{
1111
var window = Application.Current.Windows.OfType<Window>().FirstOrDefault(x => x.GetType() == typeof(T))
1212
?? (T)Activator.CreateInstance(typeof(T), args);
13-
Application.Current.MainWindow.Hide();
1413

1514
// Fix UI bug
1615
// Add `window.WindowState = WindowState.Normal`

Flow.Launcher/Images/gamemode.ico

9.44 KB
Binary file not shown.

Flow.Launcher/Languages/en.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<system:String x:Key="iconTrayAbout">About</system:String>
1616
<system:String x:Key="iconTrayExit">Exit</system:String>
1717
<system:String x:Key="closeWindow">Close</system:String>
18+
<system:String x:Key="GameMode">Game Mode</system:String>
1819

1920
<!-- Setting General -->
2021
<system:String x:Key="flowlauncher_settings">Flow Launcher Settings</system:String>
@@ -83,6 +84,10 @@
8384
<system:String x:Key="theme_load_failure_parse_error">Fail to load theme {0}, fallback to default theme</system:String>
8485
<system:String x:Key="ThemeFolder">Theme Folder</system:String>
8586
<system:String x:Key="OpenThemeFolder">Open Theme Folder</system:String>
87+
<system:String x:Key="SoundEffect">Sound Effect</system:String>
88+
<system:String x:Key="SoundEffectTip">Play a small sound when the search window opens</system:String>
89+
<system:String x:Key="Animation">Animation</system:String>
90+
<system:String x:Key="AnimationTip">Use Animation in UI</system:String>
8691

8792
<!-- Setting Hotkey -->
8893
<system:String x:Key="hotkey">Hotkey</system:String>

0 commit comments

Comments
 (0)