fix: apply message rounding in more places

This commit is contained in:
AlexeyZavar
2026-06-17 13:58:49 +03:00
parent 34bfeb7058
commit 6faf41994e
3 changed files with 33 additions and 18 deletions
@@ -35,6 +35,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_chat.h"
#include "styles/style_polls.h"
// AyuGram includes
#include "ui/chat/chat_style_radius.h"
namespace HistoryView {
namespace {
@@ -302,7 +306,7 @@ void SimilarChannels::draw(Painter &p, const PaintContext &context) const {
if (cachedp) {
q->setCompositionMode(QPainter::CompositionMode_DestinationIn);
const auto corners = _roundedCorners.data();
const auto side = st::bubbleRadiusLarge;
const auto side = Ui::BubbleRadiusLarge();
q->drawImage(0, 0, corners[Images::kTopLeft]);
q->drawImage(width() - side, 0, corners[Images::kTopRight]);
q->drawImage(0, height() - side, corners[Images::kBottomLeft]);
@@ -473,7 +477,7 @@ void SimilarChannels::ensureCacheReady(QSize size) const {
QImage::Format_ARGB32_Premultiplied);
_roundedCache.setDevicePixelRatio(ratio);
}
const auto radius = st::bubbleRadiusLarge;
const auto radius = Ui::BubbleRadiusLarge();
if (_roundedCorners.front().size() != QSize(radius, radius) * ratio) {
_roundedCorners = Images::CornersMask(radius);
}
@@ -32,7 +32,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtGui/QScreen>
// AyuGram includes
#include "ayu/ayu_settings.h"
#include "ayu/ui/ayu_userpic.h"
#include "ui/chat/chat_style_radius.h"
namespace Settings {
@@ -704,13 +706,15 @@ void Preview::paintReply(Painter &p, QRect clip) {
outline,
_replyRect.height());
p.drawRoundedRect(_replyRect, radius, radius);
p.setOpacity(Ui::kDefaultBgOpacity);
p.setClipRect(
_replyRect.x() + outline,
_replyRect.y(),
_replyRect.width() - outline,
_replyRect.height());
p.drawRoundedRect(_replyRect, radius, radius);
if (!AyuSettings::getInstance().simpleQuotesAndReplies()) {
p.setOpacity(Ui::kDefaultBgOpacity);
p.setClipRect(
_replyRect.x() + outline,
_replyRect.y(),
_replyRect.width() - outline,
_replyRect.height());
p.drawRoundedRect(_replyRect, radius, radius);
}
}
p.setOpacity(1.);
p.setClipping(false);
@@ -769,7 +773,7 @@ void Preview::validateBubbleCache() {
if (!_bubbleCorners.p[0].isNull()) {
return;
}
const auto radius = scaled(16); // st::bubbleRadiusLarge
const auto radius = scaled(Ui::BubbleRadiusLarge());
_bubbleCorners = Ui::PrepareCornerPixmaps(radius, st::msgInBg);
_bubbleCorners.p[2] = {};
_bubbleTail = scaled(st::historyBubbleTailInLeft, st::msgInBg->c);
@@ -28,6 +28,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtGui/QFontDatabase>
// AyuGram includes
#include "ayu/ayu_settings.h"
#include "ui/chat/chat_style_radius.h"
namespace Ui {
namespace {
@@ -638,7 +643,7 @@ void PreviewPainter::validateBubbleCache() {
if (!_bubbleCorners.p[0].isNull()) {
return;
}
const auto radius = st::bubbleRadiusLarge;
const auto radius = Ui::BubbleRadiusLarge();
_bubbleCorners = Ui::PrepareCornerPixmaps(radius, _msgBg.color());
_bubbleCorners.p[2] = {};
_bubbleShadowBottomRight
@@ -669,13 +674,15 @@ void PreviewPainter::paintReply(Painter &p) {
outline,
_replyRect.height());
p.drawRoundedRect(_replyRect, radius, radius);
p.setOpacity(Ui::kDefaultBgOpacity);
p.setClipRect(
_replyRect.x() + outline,
_replyRect.y(),
_replyRect.width() - outline,
_replyRect.height());
p.drawRoundedRect(_replyRect, radius, radius);
if (!AyuSettings::getInstance().simpleQuotesAndReplies()) {
p.setOpacity(Ui::kDefaultBgOpacity);
p.setClipRect(
_replyRect.x() + outline,
_replyRect.y(),
_replyRect.width() - outline,
_replyRect.height());
p.drawRoundedRect(_replyRect, radius, radius);
}
}
p.setOpacity(1.);
p.setClipping(false);