Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
342bf30
- Add Slide Up Animation
onesounds Nov 11, 2021
a4e941b
Change Property toggle base to Var from visibility
onesounds Nov 11, 2021
5a969b2
Add InitPosition in WindowAnimator
onesounds Nov 12, 2021
f1222f9
Fix Positioning when turn on remember last launch position
onesounds Nov 12, 2021
6d8ee64
- Change trigger animation Timing
onesounds Nov 12, 2021
037c343
- Change InitializePosition for load setting
onesounds Nov 13, 2021
4a86962
- Fix RememberLastPosition when Re-Excute
onesounds Nov 13, 2021
6744e21
Remove some unused code
taooceros Nov 13, 2021
ca2d696
Remove redundant animation and potential position change
taooceros Nov 13, 2021
62eb1b6
- Add Sound
onesounds Nov 13, 2021
15266f2
- Add time for hide when open setting (using context menu)
onesounds Nov 14, 2021
42f1b57
- Change Setting Window Size to responsive
onesounds Nov 14, 2021
838d6c5
Remove Left Positioning Code in animation
onesounds Nov 14, 2021
e04944f
Merge Dev
onesounds Nov 14, 2021
b17f12b
change wav file to resource
onesounds Nov 14, 2021
37858a4
Change Sound FIle
onesounds Nov 14, 2021
5a430bf
Change Wav to output
onesounds Nov 14, 2021
abe4eec
fix Wav output setting
onesounds Nov 14, 2021
f8cfa7c
Remove Resize Settting window code (It made weired blink when open se…
onesounds Nov 14, 2021
a2600af
- Add Show() function and seperate toggleflow()
onesounds Nov 14, 2021
add99c4
- Change MainwindowVisibility to using show()
onesounds Nov 14, 2021
e8e1393
Change UseSound to Default.
onesounds Nov 15, 2021
7107386
- Fix First Launch Position to Center
onesounds Nov 16, 2021
0cb3d05
Merge branch 'dev' into RealFinalAnimation
onesounds Nov 16, 2021
a301d8e
Adjust Position Update Timing
onesounds Nov 18, 2021
eaf0649
Add Delay to Opacity when Main Window Deactive
onesounds Nov 19, 2021
4525043
Change Icon uniform property from uniformtofill (Fix wide icon cut)
onesounds Nov 19, 2021
e500b35
Apply suggestions from code review
onesounds Nov 19, 2021
7a0ef5c
Update Flow.Launcher/Languages/en.xaml
onesounds Nov 19, 2021
8f1a9bf
Remove Save in OnDeactivated
onesounds Nov 19, 2021
23ba5e9
Merge branch 'dev' into RealFinalAnimation
jjw24 Nov 20, 2021
3c78802
- move sound play code to animator from show
onesounds Nov 20, 2021
89677ff
Merge branch 'RealFinalAnimation' of https://github.com/onesounds/Flo…
onesounds Nov 20, 2021
3eeac91
Add Animation in Glass Icon
onesounds Nov 20, 2021
e30af37
Adjust Delay Duration to fix blink
onesounds Nov 22, 2021
e282fc5
- Remove visible/collapsed code (only using opacity)
onesounds Nov 22, 2021
4df1e41
Revert "- Remove visible/collapsed code (only using opacity)"
onesounds Nov 22, 2021
df4f94f
Adjust Delay for ondeactivated
onesounds Nov 22, 2021
7b4867d
prevent re-triggering on deactivated
jjw24 Nov 23, 2021
49b3a02
Adjust Animation Time
onesounds Nov 26, 2021
c94a04b
refinements to delay and show hide toggle
jjw24 Nov 27, 2021
091b4af
switch to use main window's Show method
jjw24 Nov 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Windows;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Media;
using System.Windows.Controls;
using System.Windows.Forms;
using Flow.Launcher.Core.Plugin;
Expand Down Expand Up @@ -243,7 +244,6 @@ public void WindowAnimator()
{
if (_animating)
return;

_animating = true;
UpdatePosition();
Storyboard sb = new Storyboard();
Expand Down Expand Up @@ -272,6 +272,12 @@ public void WindowAnimator()
_settings.WindowTop = Top;
sb.Begin(FlowMainWindow);
}
if (_settings.UseSound)
{
MediaPlayer media = new MediaPlayer();
media.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
media.Play();
}
}

private void OnMouseDown(object sender, MouseButtonEventArgs e)
Expand Down Expand Up @@ -309,7 +315,7 @@ private void OnPreviewDragOver(object sender, DragEventArgs e)
private async void OnContextMenusForSettingsClick(object sender, RoutedEventArgs e)
{
_viewModel.Hide();
await Task.Delay(100);
await Task.Delay(50);
App.API.OpenSettingDialog();
}

Expand All @@ -318,7 +324,7 @@ private async void OnDeactivated(object sender, EventArgs e)
{
// need time to initialize the main query window animation
if (_settings.UseAnimation)
await Task.Delay(100);
await Task.Delay(50);
if (_settings.HideWhenDeactive)
{
_viewModel.Hide();
Expand Down
45 changes: 10 additions & 35 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
using System.Windows;
using System.Windows.Media;
using System.Windows.Input;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Core.Resource;
Expand Down Expand Up @@ -157,26 +156,6 @@ private void RegisterResultsUpdatedEvent()
};
}
}

private void UpdateLastQUeryMode()
{
switch (_settings.LastQueryMode)
{
case LastQueryMode.Empty:
ChangeQueryText(string.Empty);
break;
case LastQueryMode.Preserved:
LastQuerySelected = true;
break;
case LastQueryMode.Selected:
LastQuerySelected = false;
break;
default:
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");

}
}

private void InitializeKeyCommands()
{
EscCommand = new RelayCommand(_ =>
Expand Down Expand Up @@ -383,7 +362,6 @@ private ResultsViewModel SelectedResults
public Visibility MainWindowVisibility { get; set; }
public double MainWindowOpacity { get; set; } = 1;
public bool WinToggleStatus { get; set; } = true;

public double MainWindowWidth => _settings.WindowSize;

public ICommand EscCommand { get; set; }
Expand Down Expand Up @@ -720,45 +698,42 @@ public void ToggleFlowLauncher()
Hide();
}
}

public void Show()
{
if (_settings.UseSound)
{
MediaPlayer media = new MediaPlayer();
media.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
media.Play();
}
((MainWindow)Application.Current.MainWindow).WindowAnimator();
MainWindowVisibility = Visibility.Visible;
WinToggleStatus = true;
((MainWindow)Application.Current.MainWindow).WindowAnimator();
MainWindowOpacity = 1;
}

public async void Hide()
{
MainWindowOpacity = 0;
switch (_settings.LastQueryMode)
{
case LastQueryMode.Empty:
ChangeQueryText(string.Empty);
MainWindowOpacity = 0; // Trick for no delay
await Task.Delay(100); //Time for change to opacity
await Task.Delay(50); //Time for change to opacity
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you know, in this case, there should be a delay regardless of animation because the query should be erased.

break;
case LastQueryMode.Preserved:
MainWindowOpacity = 0;
await Task.Delay(100);
if (_settings.UseAnimation)
{
await Task.Delay(30);
}
LastQuerySelected = true;
break;
case LastQueryMode.Selected:
MainWindowOpacity = 0;
await Task.Delay(100);
if (_settings.UseAnimation)
{
await Task.Delay(30);
}
LastQuerySelected = false;
break;
default:
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
}

WinToggleStatus = false;
MainWindowVisibility = Visibility.Collapsed;
}
Expand Down