Skip to content

Conversation

@onesounds
Copy link
Contributor

@onesounds onesounds commented Nov 12, 2021

bandicam.2021-11-12.11-07-08-371.mp4

ETC

  • Fix Blink Animation when close setting window
  • Change 'Open' tray menu to toggle
  • Change Hide/Open Code with out using visibility base
  • Reduce Height of setting window Change Setting window Height to responsible (80% of Screen Height)

@onesounds onesounds self-assigned this Nov 12, 2021
@onesounds onesounds marked this pull request as ready for review November 14, 2021 02:37
@onesounds onesounds added enhancement New feature or request kind/ui related to UI, icons, themes, etc labels Nov 14, 2021
@onesounds onesounds added this to the 1.9.0 milestone Nov 14, 2021
@onesounds onesounds changed the title Animation Add Animation and Sound / Fix Last Executed Position Nov 14, 2021
@onesounds
Copy link
Contributor Author

If we apply this pr, we should all use this code later. Visibility should not be used directly as possible, but should be toss to animation code.

@jjw24
Copy link
Member

jjw24 commented Nov 15, 2021

when started up, the search bar's position is moved to the right, and then readjusted after one deactivate-reactivate

onesounds and others added 4 commits November 19, 2021 19:34
- Adjusting the delay time.
- Delete unused code.
- Process so that there is no delay when the animation settings are turned off. (Exclude erasing queries.)
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.

@onesounds
Copy link
Contributor Author

If you toggle continuously very quickly with the animation setting on, there are cases where the frame is still wrong. (Blinking momentarily when the flow is turned on in this state.) It needs to be very fast, I think it's an unusual situation, and I think it's okay to leave it as it is.

Overall, since the delay time was reduced, the response thought to be a little slow would have decreased.

@jjw24
Copy link
Member

jjw24 commented Nov 21, 2021

looks like the extra hide is gone when switching three times quickly.

the old problem where it flickers when Settings window is opened or closed is back.

@onesounds
Copy link
Contributor Author

looks like the extra hide is gone when switching three times quickly.

the old problem where it flickers when Settings window is opened or closed is back.

This problem occurs when the window is opened in the "animation off state" and changed back to the "animation on state". This is because when the window is turned on in the animation off state, there is no delay, so it remains in the opacity 1 state. In other words, problems arise because it is not initialized when closing the window.

Therefore, the window hiding during ondeactivation was modified to add a delay regardless of animation setting.

case where without it the toggle hidden is fired and then ondeactivated is also fired but with delay, and hides the window again
sb.Completed += (_, _) => _animating = false;
_settings.WindowLeft = Left;
_settings.WindowTop = Top;
iconsb.Begin(SearchIcon);
Copy link
Member

@jjw24 jjw24 Nov 23, 2021

Choose a reason for hiding this comment

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

is this change intended for this pr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, for Icon animation.

Copy link
Member

Choose a reason for hiding this comment

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

The search icon seems to just jump up a little as if to reposition itself to the right height. Is this the same case for you?

@onesounds
Copy link
Contributor Author

Is there anything else you want me to fix?
There is still an issue that flashes when setting is changed in a specific situation, but I don't think there is a problem with actual use. I think it's a problem that you can just go. This part is difficult to fix.

@jjw24
Copy link
Member

jjw24 commented Nov 26, 2021

i am still doing some testing with it and making minor updates, will push up later.

@jjw24
Copy link
Member

jjw24 commented Nov 26, 2021

what is WinToggleStatus used for exactly? Seems to function the same as Visibility check

@onesounds
Copy link
Contributor Author

onesounds commented Nov 26, 2021

what is WinToggleStatus used for exactly? Seems to function the same as Visibility check

Logically, there's no problem. but there was a blinking problem. I added a variable for toggle separately because I saw an advice not to use visibility as a trigger when using this kind of animation. and I felt that the data was modulated because there were codes everywhere that changed visibility.

I tested it once in the middle of this PR, and if all the visibility code is changed to opacity = 0 or 1, it will be updated even if it is not visible on the screen, so it will work even after removing all the delays, and logically, it will all work properly if I use trigger base visibility. In this method, a window exists in alt+tab, and consideration was canceled due to the problem of receiving input even if it was not visible on the screen. If we solve the alt tab and focus problem, I think this method is also good.

In principle, if the UI is updated even in the hidden/visible state, the animation can be initialized, the delay can be eliminated, and all blinking problems disappear. It's the same issue as lastemptyquery. These codes were created because this method was not available. To solve a number of problems existing in this code, a method of updating the UI even if a window is hidden on the screen must be implemented first. Things such as background worker, dispatcher, and invoke are needed. This plan is one of the solutions already proposed in the lastemptyquery and has not been considered because it cannot be implemented.

@jjw24 jjw24 enabled auto-merge November 27, 2021 02:54
@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Nov 27, 2021
@jjw24
Copy link
Member

jjw24 commented Nov 27, 2021

I just did some refinements based on extensive testing, mainly around delay and show/hide calls. In some extreme scenarios as you mentioned as well, there are still flickering, but those edge cases aside I think this now is good.

@jjw24 jjw24 merged commit 5e57d73 into Flow-Launcher:dev Nov 27, 2021
@jjw24
Copy link
Member

jjw24 commented Nov 27, 2021

Some points as a result of testing this change I want to record below for future reference incase needed:

  • MainWindowOpacity is used to stop from mainwindow slow flickering when used with animation

  • Task.Delay(100) is used to stop from mainwindow fast flickering when used with animation

  • Application.Current.MainWindow.Hide(); is removed from SingletonWindowOpener class because it caused flickering when Setting window is opened

  • Toggling mainwindow to show immediately after opening Setting window when animation is off triggers an extra OnDeactivated call at the end, causing the mainwindow to be hidden. The Application.Current.MainWindow.Hide() from SingletonWindowOpener was used to combat this so with it the mainwindow will actually show as intended. However using this caused flickering with animation when Settings window is opened, so it's removed.

  • toggling very quickly on off mainwindow, with animation on, the Hide() is called sometimes instead of Show(), so the hide->show->hide->show sequence is not exactly honoured. toggling slower will not have this issue, neither does doing it without animation. This is likely due to the Task.Delay(100).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request kind/ui related to UI, icons, themes, etc

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants