From 31fd8f3d559a167b0e92363ca3014471139141de Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Mon, 28 Dec 2020 01:34:06 +0300 Subject: [PATCH] Fix rounding of userpics in comments --- .../view/history_view_group_call_tracker.cpp | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_group_call_tracker.cpp b/Telegram/SourceFiles/history/view/history_view_group_call_tracker.cpp index 0dd370922..deb94e82e 100644 --- a/Telegram/SourceFiles/history/view/history_view_group_call_tracker.cpp +++ b/Telegram/SourceFiles/history/view/history_view_group_call_tracker.cpp @@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "calls/calls_instance.h" #include "core/application.h" #include "styles/style_chat.h" +#include "styles/style_widgets.h" namespace HistoryView { @@ -56,7 +57,28 @@ void GenerateUserpicsInRow( q.setCompositionMode(QPainter::CompositionMode_Source); q.setBrush(Qt::NoBrush); q.setPen(pen); - q.drawEllipse(x, 0, single, single); + switch (cUserpicCornersType()) { + case 0: + q.drawRoundedRect( + QRect{ x, 0, single, single }, + 0, 0); + break; + + case 1: + q.drawRoundedRect( + QRect{ x, 0, single, single }, + st::buttonRadius, st::buttonRadius); + break; + + case 2: + q.drawRoundedRect( + QRect{ x, 0, single, single }, + st::dateRadius, st::dateRadius); + break; + + default: + q.drawEllipse(x, 0, single, single); + } x -= single - shift; } }