2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fixed changing of button style between states within single intro step.

This commit is contained in:
23rd
2022-12-29 23:25:53 +03:00
parent 567216f41f
commit 693ff3398e
5 changed files with 41 additions and 27 deletions

View File

@@ -342,17 +342,21 @@ void Widget::historyMove(StackAction action, Animate animate) {
hideAndDestroy(std::exchange(_terms, { nullptr }));
}
{
const auto st = getStep()->nextButtonStyle();
const auto nextStyle = st ? st : &st::introNextButton;
if (_nextStyle != nextStyle) {
_nextStyle = nextStyle;
_next = nullptr;
_next.create(
this,
object_ptr<Ui::RoundButton>(this, nullptr, *nextStyle));
showControls();
updateControlsGeometry();
}
getStep()->nextButtonStyle(
) | rpl::start_with_next([=](const style::RoundButton *st) {
const auto nextStyle = st ? st : &st::introNextButton;
if (_nextStyle != nextStyle) {
_nextStyle = nextStyle;
const auto wasShown = _next->toggled();
_next.destroy();
_next.create(
this,
object_ptr<Ui::RoundButton>(this, nullptr, *nextStyle));
showControls();
updateControlsGeometry();
_next->toggle(wasShown, anim::type::instant);
}
}, _next->lifetime());
}
getStep()->finishInit();