2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Improve info layer presentation.

This commit is contained in:
John Preston
2017-11-19 15:37:15 +04:00
parent 59938791ef
commit de15da8a93
8 changed files with 72 additions and 31 deletions

View File

@@ -60,10 +60,11 @@ SlideWrap<RpWidget> *SlideWrap<RpWidget>::setDuration(int duration) {
SlideWrap<RpWidget> *SlideWrap<RpWidget>::toggle(
bool shown,
anim::type animated) {
auto animate = (animated == anim::type::normal) && _duration;
auto changed = (_toggled != shown);
if (changed) {
_toggled = shown;
if (animated == anim::type::normal) {
if (animate) {
_animation.start(
[this] { animationStep(); },
_toggled ? 0. : 1.,
@@ -72,7 +73,7 @@ SlideWrap<RpWidget> *SlideWrap<RpWidget>::toggle(
anim::linear);
}
}
if (animated == anim::type::normal) {
if (animate) {
animationStep();
} else {
finishAnimating();