mirror of https://github.com/procxx/kepka.git
Fix animation lag in shared media.
This commit is contained in:
parent
47a52b0587
commit
a7807420fa
|
@ -319,7 +319,7 @@ object_ptr<Ui::RpWidget> InnerWidget::setupSharedMedia(
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
tracker.atLeastOneShownValue(),
|
tracker.atLeastOneShownValue(),
|
||||||
_controller->wrapValue(),
|
_controller->wrapValue(),
|
||||||
_isStackBottom.events())
|
_isStackBottom.value())
|
||||||
| rpl::combine_previous(ToggledData())
|
| rpl::combine_previous(ToggledData())
|
||||||
| rpl::start_with_next([wrap = result.data()](
|
| rpl::start_with_next([wrap = result.data()](
|
||||||
const ToggledData &was,
|
const ToggledData &was,
|
||||||
|
@ -333,7 +333,7 @@ object_ptr<Ui::RpWidget> InnerWidget::setupSharedMedia(
|
||||||
//auto [nowOneShown, nowWrap, nowStackBottom] = now;
|
//auto [nowOneShown, nowWrap, nowStackBottom] = now;
|
||||||
wrap->toggle(
|
wrap->toggle(
|
||||||
nowOneShown && (nowWrap != Wrap::Side || !nowStackBottom),
|
nowOneShown && (nowWrap != Wrap::Side || !nowStackBottom),
|
||||||
(wasOneShown == nowOneShown && wasWrap == nowWrap)
|
(wasStackBottom == nowStackBottom && wasWrap == nowWrap)
|
||||||
? anim::type::normal
|
? anim::type::normal
|
||||||
: anim::type::instant);
|
: anim::type::instant);
|
||||||
}, result->lifetime());
|
}, result->lifetime());
|
||||||
|
|
|
@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <rpl/producer.h>
|
#include <rpl/variable.h>
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/rp_widget.h"
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
|
@ -55,7 +55,7 @@ public:
|
||||||
void restoreState(not_null<Memento*> memento);
|
void restoreState(not_null<Memento*> memento);
|
||||||
|
|
||||||
void setIsStackBottom(bool isStackBottom) {
|
void setIsStackBottom(bool isStackBottom) {
|
||||||
_isStackBottom.fire_copy(isStackBottom);
|
_isStackBottom = isStackBottom;
|
||||||
}
|
}
|
||||||
rpl::producer<Ui::ScrollToRequest> scrollToRequests() const {
|
rpl::producer<Ui::ScrollToRequest> scrollToRequests() const {
|
||||||
return _scrollToRequests.events();
|
return _scrollToRequests.events();
|
||||||
|
@ -94,7 +94,7 @@ private:
|
||||||
bool canHideDetailsEver() const;
|
bool canHideDetailsEver() const;
|
||||||
rpl::producer<bool> canHideDetails() const;
|
rpl::producer<bool> canHideDetails() const;
|
||||||
|
|
||||||
rpl::event_stream<bool> _isStackBottom;
|
rpl::variable<bool> _isStackBottom = true;
|
||||||
|
|
||||||
const not_null<Controller*> _controller;
|
const not_null<Controller*> _controller;
|
||||||
const not_null<PeerData*> _peer;
|
const not_null<PeerData*> _peer;
|
||||||
|
|
Loading…
Reference in New Issue