mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-12 04:07:08 +02:00
Notifications: stop fading in before starting to fade out
When a notification is to start hiding (i.e., fade out), it is supposed to start fading out from the maximum opacity, even if it was not fully restored (which only happens if the cursor passed through the notification too quickly). Thus, call `.stop()` for the previous animation, if any, before `.start()`ing the next animation.
This commit is contained in:
parent
7f6221b409
commit
03af444735
1 changed files with 4 additions and 0 deletions
|
@ -549,6 +549,10 @@ void Widget::hideStop() {
|
|||
|
||||
void Widget::hideAnimated(float64 duration, const anim::transition &func) {
|
||||
_hiding = true;
|
||||
// Stop the previous animation so as to make sure that the notification
|
||||
// is fully restored before hiding it again.
|
||||
// Relates to https://github.com/telegramdesktop/tdesktop/issues/28811.
|
||||
_a_opacity.stop();
|
||||
_a_opacity.start([this] { opacityAnimationCallback(); }, 1., 0., duration, func);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue