Added ability to pass animation type to SlideWrap.
This commit is contained in:
parent
b8485c0d8a
commit
9c552215ab
2 changed files with 11 additions and 6 deletions
|
|
@ -80,11 +80,12 @@ SlideWrap<RpWidget> *SlideWrap<RpWidget>::finishAnimating() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SlideWrap<RpWidget> *SlideWrap<RpWidget>::toggleOn(
|
SlideWrap<RpWidget> *SlideWrap<RpWidget>::toggleOn(
|
||||||
rpl::producer<bool> &&shown) {
|
rpl::producer<bool> &&shown,
|
||||||
|
anim::type animated) {
|
||||||
std::move(
|
std::move(
|
||||||
shown
|
shown
|
||||||
) | rpl::start_with_next([this](bool shown) {
|
) | rpl::start_with_next([=](bool shown) {
|
||||||
toggle(shown, anim::type::normal);
|
toggle(shown, animated);
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
finishAnimating();
|
finishAnimating();
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,9 @@ public:
|
||||||
return toggle(false, animated);
|
return toggle(false, animated);
|
||||||
}
|
}
|
||||||
SlideWrap *finishAnimating();
|
SlideWrap *finishAnimating();
|
||||||
SlideWrap *toggleOn(rpl::producer<bool> &&shown);
|
SlideWrap *toggleOn(
|
||||||
|
rpl::producer<bool> &&shown,
|
||||||
|
anim::type animated = anim::type::normal);
|
||||||
|
|
||||||
bool animating() const {
|
bool animating() const {
|
||||||
return _animation.animating();
|
return _animation.animating();
|
||||||
|
|
@ -104,8 +106,10 @@ public:
|
||||||
SlideWrap *finishAnimating() {
|
SlideWrap *finishAnimating() {
|
||||||
return chain(Parent::finishAnimating());
|
return chain(Parent::finishAnimating());
|
||||||
}
|
}
|
||||||
SlideWrap *toggleOn(rpl::producer<bool> &&shown) {
|
SlideWrap *toggleOn(
|
||||||
return chain(Parent::toggleOn(std::move(shown)));
|
rpl::producer<bool> &&shown,
|
||||||
|
anim::type animated = anim::type::normal) {
|
||||||
|
return chain(Parent::toggleOn(std::move(shown), animated));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue