mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-20 23:27:23 +00:00
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(
|
||||
tracker.atLeastOneShownValue(),
|
||||
_controller->wrapValue(),
|
||||
_isStackBottom.events())
|
||||
_isStackBottom.value())
|
||||
| rpl::combine_previous(ToggledData())
|
||||
| rpl::start_with_next([wrap = result.data()](
|
||||
const ToggledData &was,
|
||||
@ -333,7 +333,7 @@ object_ptr<Ui::RpWidget> InnerWidget::setupSharedMedia(
|
||||
//auto [nowOneShown, nowWrap, nowStackBottom] = now;
|
||||
wrap->toggle(
|
||||
nowOneShown && (nowWrap != Wrap::Side || !nowStackBottom),
|
||||
(wasOneShown == nowOneShown && wasWrap == nowWrap)
|
||||
(wasStackBottom == nowStackBottom && wasWrap == nowWrap)
|
||||
? anim::type::normal
|
||||
: anim::type::instant);
|
||||
}, result->lifetime());
|
||||
|
@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <rpl/producer.h>
|
||||
#include <rpl/variable.h>
|
||||
#include "ui/rp_widget.h"
|
||||
|
||||
namespace Window {
|
||||
@ -55,7 +55,7 @@ public:
|
||||
void restoreState(not_null<Memento*> memento);
|
||||
|
||||
void setIsStackBottom(bool isStackBottom) {
|
||||
_isStackBottom.fire_copy(isStackBottom);
|
||||
_isStackBottom = isStackBottom;
|
||||
}
|
||||
rpl::producer<Ui::ScrollToRequest> scrollToRequests() const {
|
||||
return _scrollToRequests.events();
|
||||
@ -94,7 +94,7 @@ private:
|
||||
bool canHideDetailsEver() const;
|
||||
rpl::producer<bool> canHideDetails() const;
|
||||
|
||||
rpl::event_stream<bool> _isStackBottom;
|
||||
rpl::variable<bool> _isStackBottom = true;
|
||||
|
||||
const not_null<Controller*> _controller;
|
||||
const not_null<PeerData*> _peer;
|
||||
|
Loading…
Reference in New Issue
Block a user