From 4ee7d46d788a791a0df7dcf0f3196b5492309c13 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 21 Aug 2024 19:25:58 +0300 Subject: [PATCH] Improved static infinite radial animation in panel of webview bot. --- .../SourceFiles/ui/chat/attach/attach_bot_webview.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp index 2e8f3f345..412b5753b 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp @@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/wrap/fade_wrap.h" #include "ui/integration.h" #include "ui/painter.h" +#include "ui/rect.h" #include "lang/lang_keys.h" #include "webview/webview_embed.h" #include "webview/webview_dialog.h" @@ -397,14 +398,13 @@ void Panel::toggleProgress(bool shown) { auto p = QPainter(&_progress->widget); p.setOpacity( _progress->shownAnimation.value(_progress->shown ? 1. : 0.)); - auto thickness = st::paymentsLoading.thickness; + const auto thickness = st::paymentsLoading.thickness; if (progressWithBackground()) { auto color = st::windowBg->c; color.setAlphaF(kProgressOpacity); p.fillRect(clip, color); } - const auto rect = progressRect().marginsRemoved( - { thickness, thickness, thickness, thickness }); + const auto rect = progressRect() - Margins(thickness); InfiniteRadialAnimation::Draw( p, _progress->animation.computeState(), @@ -412,7 +412,7 @@ void Panel::toggleProgress(bool shown) { rect.size() - QSize(), _progress->widget.width(), st::paymentsLoading.color, - thickness); + anim::Disabled() ? (thickness / 2.) : thickness); }, _progress->widget.lifetime()); _progress->widget.show(); _progress->animation.start();