From db453ab7ae984b35899538eb9b358ba171b295ab Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 11 Jan 2022 17:12:41 +0300 Subject: [PATCH] Allow slowing down Animations::Simple in debug build. --- Telegram/SourceFiles/mainwindow.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index fe0d3484b..e32acb594 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -630,11 +630,20 @@ bool MainWindow::eventFilter(QObject *object, QEvent *e) { switch (e->type()) { case QEvent::KeyPress: { if (Logs::DebugEnabled() - && (e->type() == QEvent::KeyPress) && object == windowHandle()) { - auto key = static_cast(e)->key(); + const auto key = static_cast(e)->key(); FeedLangTestingKey(key); } +#ifdef _DEBUG + switch (static_cast(e)->key()) { + case Qt::Key_F3: + anim::SetSlowMultiplier((anim::SlowMultiplier() == 10) ? 1 : 10); + return true; + case Qt::Key_F4: + anim::SetSlowMultiplier((anim::SlowMultiplier() == 50) ? 1 : 50); + return true; + } +#endif } break; case QEvent::MouseMove: {