From 465a33f095bc818ce38a259aa2c5d7fe309abd85 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 20 Jan 2023 11:23:23 +0300 Subject: [PATCH] Fixed display of loading peer list item in choose forum topic box. --- .../boxes/peer_list_controllers.cpp | 5 +++- Telegram/SourceFiles/dialogs/dialogs.style | 4 ++-- .../ui/effects/loading_element.cpp | 24 +++++++++++-------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp index 98729bc49..a5b8267da 100644 --- a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp @@ -633,10 +633,13 @@ auto ChooseTopicBoxController::Row::generatePaintUserpicCallback( int y, int outerWidth, int size) { + const auto &st = st::forumTopicRow; + x -= st.padding.left(); + y -= st.padding.top(); auto view = Ui::PeerUserpicView(); p.translate(x, y); _topic->paintUserpic(p, view, { - .st = &st::forumTopicRow, + .st = &st, .currentBg = st::windowBg, .now = crl::now(), .width = outerWidth, diff --git a/Telegram/SourceFiles/dialogs/dialogs.style b/Telegram/SourceFiles/dialogs/dialogs.style index 0dc080092..845f9459a 100644 --- a/Telegram/SourceFiles/dialogs/dialogs.style +++ b/Telegram/SourceFiles/dialogs/dialogs.style @@ -475,8 +475,8 @@ editTopicMaxHeight: 408px; chooseTopicListItem: PeerListItem(defaultPeerListItem) { height: 44px; - photoSize: 28px; - photoPosition: point(8px, 5px); + photoSize: 20px; + photoPosition: point(16px, 12px); namePosition: point(55px, 11px); nameStyle: TextStyle(defaultTextStyle) { font: font(14px semibold); diff --git a/Telegram/SourceFiles/ui/effects/loading_element.cpp b/Telegram/SourceFiles/ui/effects/loading_element.cpp index 6ff648cb4..5e30157c2 100644 --- a/Telegram/SourceFiles/ui/effects/loading_element.cpp +++ b/Telegram/SourceFiles/ui/effects/loading_element.cpp @@ -7,12 +7,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "ui/effects/loading_element.h" -#include "ui/effects/glare.h" - #include "base/object_ptr.h" #include "base/random.h" #include "styles/palette.h" +#include "ui/effects/glare.h" #include "ui/painter.h" +#include "ui/rect.h" #include "ui/rp_widget.h" #include "styles/style_basic.h" #include "styles/style_widgets.h" @@ -99,14 +99,18 @@ public: h1 / 2, h1 / 2); - const auto h2 = st::defaultTextStyle.font->ascent; - p.drawRoundedRect( - _st.statusPosition.x(), - _st.statusPosition.y() + offset, - kStatusWidth, - h2, - h2 / 2, - h2 / 2); + { + const auto h2 = st::defaultTextStyle.font->ascent; + const auto radius = h2 / 2; + const auto rect = QRect( + _st.statusPosition.x(), + _st.statusPosition.y() + offset, + kStatusWidth, + h2); + if (rect::bottom(rect) < height()) { + p.drawRoundedRect(rect, radius, radius); + } + } } private: