mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 14:08:41 +00:00
Disabled animation for first showing of right button in pinned bar.
This commit is contained in:
@@ -82,6 +82,7 @@ void PinnedBar::setContent(rpl::producer<Ui::MessageBarContent> content) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PinnedBar::setRightButton(object_ptr<Ui::RpWidget> button) {
|
void PinnedBar::setRightButton(object_ptr<Ui::RpWidget> button) {
|
||||||
|
const auto hasPrevious = (_right.button != nullptr);
|
||||||
if (auto previous = _right.button.release()) {
|
if (auto previous = _right.button.release()) {
|
||||||
_right.previousButtonLifetime.make_state<RightButton>(
|
_right.previousButtonLifetime.make_state<RightButton>(
|
||||||
RightButton::fromRaw(std::move(previous)));
|
RightButton::fromRaw(std::move(previous)));
|
||||||
@@ -94,8 +95,13 @@ void PinnedBar::setRightButton(object_ptr<Ui::RpWidget> button) {
|
|||||||
_right.button.create(_wrap.entity(), std::move(button));
|
_right.button.create(_wrap.entity(), std::move(button));
|
||||||
if (_right.button) {
|
if (_right.button) {
|
||||||
_right.button->setParent(_wrap.entity());
|
_right.button->setParent(_wrap.entity());
|
||||||
|
if (hasPrevious) {
|
||||||
_right.button->setDuration(st::defaultMessageBar.duration);
|
_right.button->setDuration(st::defaultMessageBar.duration);
|
||||||
_right.button->show(anim::type::normal);
|
_right.button->show(anim::type::normal);
|
||||||
|
} else {
|
||||||
|
_right.button->setDuration(0);
|
||||||
|
_right.button->show(anim::type::instant);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (_bar) {
|
if (_bar) {
|
||||||
updateControlsGeometry(_wrap.geometry());
|
updateControlsGeometry(_wrap.geometry());
|
||||||
|
Reference in New Issue
Block a user