2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Added first state to snowflakes effect in main menu.

This commit is contained in:
23rd
2022-12-21 17:02:40 +03:00
committed by John Preston
parent 2364b0ad4e
commit 8296d72923
5 changed files with 41 additions and 14 deletions

View File

@@ -492,6 +492,10 @@ MainMenu::MainMenu(
const auto snow = snowLifetime->make_state<Ui::Snowflakes>(
[=](const QRect &r) { snowRaw->update(r); });
snow->setBrush(QColor(230, 230, 230));
_showFinished.value(
) | rpl::start_with_next([=](bool shown) {
snow->setPaused(!shown);
}, snowRaw->lifetime());
snowRaw->paintRequest(
) | rpl::start_with_next([=](const QRect &r) {
auto p = Painter(snowRaw);
@@ -694,6 +698,10 @@ void MainMenu::parentResized() {
resize(st::mainMenuWidth, parentWidget()->height());
}
void MainMenu::showFinished() {
_showFinished = true;
}
void MainMenu::setupMenu() {
using namespace Settings;