Skip to content

Commit a2600af

Browse files
committed
- Add Show() function and seperate toggleflow()
- Change ShowMainWindow to using Show() (for Fix plugin install button)
1 parent f8cfa7c commit a2600af

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void RestartApp()
7070

7171
public void RestarApp() => RestartApp();
7272

73-
public void ShowMainWindow() => _mainVM.MainWindowVisibility = Visibility.Visible;
73+
public void ShowMainWindow() => _mainVM.Show();
7474

7575
public void CheckForNewUpdate() => _settingsVM.UpdateApp();
7676

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
using Flow.Launcher.Helper;
1616
using System.Windows.Controls;
1717
using Flow.Launcher.Core.ExternalPlugins;
18-
using Screen = System.Windows.Forms.Screen;
1918

2019
namespace Flow.Launcher
2120
{

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -713,23 +713,28 @@ public void ToggleFlowLauncher()
713713
{
714714
if (WinToggleStatus != true)
715715
{
716-
if (_settings.UseSound)
717-
{
718-
MediaPlayer media = new MediaPlayer();
719-
media.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
720-
media.Play();
721-
}
722-
MainWindowVisibility = Visibility.Visible;
723-
WinToggleStatus = true;
724-
((MainWindow)Application.Current.MainWindow).WindowAnimator();
725-
MainWindowOpacity = 1;
716+
Show();
726717
}
727718
else
728719
{
729720
Hide();
730721
}
731722
}
732723

724+
public void Show()
725+
{
726+
if (_settings.UseSound)
727+
{
728+
MediaPlayer media = new MediaPlayer();
729+
media.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
730+
media.Play();
731+
}
732+
MainWindowVisibility = Visibility.Visible;
733+
WinToggleStatus = true;
734+
((MainWindow)Application.Current.MainWindow).WindowAnimator();
735+
MainWindowOpacity = 1;
736+
}
737+
733738
public async void Hide()
734739
{
735740
MainWindowOpacity = 0;

0 commit comments

Comments
 (0)