[network/ruqola] src/widgets: Add antialiasing support
Laurent Montel <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit acc798c3dae6942c643e3d6f7e912981bb24a767 by Laurent Montel.
Committed on 31/07/2026 at 11:24.
Pushed by mlaurent into branch 'master'.
Add antialiasing support
M +1 -1 src/widgets/applicationssettingsdialog/applicationssettingsdelegate.cpp
M +1 -0 src/widgets/room/delegate/messageattachmentdelegatehelperactions.cpp
M +1 -0 src/widgets/room/delegate/messagedelegatehelperactions.cpp
M +1 -0 src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp
M +2 -0 src/widgets/room/delegate/messagedelegatehelperreactions.cpp
M +2 -2 src/widgets/room/delegate/messagedelegatehelpersection.cpp
https://invent.kde.org/network/ruqola/-/commit/acc798c3dae6942c643e3d6f7e912981bb24a767
diff --git a/src/widgets/applicationssettingsdialog/applicationssettingsdelegate.cpp b/src/widgets/applicationssettingsdialog/applicationssettingsdelegate.cpp
index 682cef3573..1557f6195b 100644
--- a/src/widgets/applicationssettingsdialog/applicationssettingsdelegate.cpp
+++ b/src/widgets/applicationssettingsdialog/applicationssettingsdelegate.cpp
@@ -41,7 +41,7 @@ void ApplicationsSettingsDelegate::paint(QPainter *painter, const QStyleOptionVi
{
painter->save();
drawBackground(painter, option, index);
-
+ painter->setRenderHint(QPainter::Antialiasing);
const int margin = MessageDelegateUtils::basicMargin();
painter->save();
painter->setPen(Qt::NoPen);
diff --git a/src/widgets/room/delegate/messageattachmentdelegatehelperactions.cpp b/src/widgets/room/delegate/messageattachmentdelegatehelperactions.cpp
index 9b582e5171..883c54ed46 100644
--- a/src/widgets/room/delegate/messageattachmentdelegatehelperactions.cpp
+++ b/src/widgets/room/delegate/messageattachmentdelegatehelperactions.cpp
@@ -40,6 +40,7 @@ void MessageAttachmentDelegateHelperActions::draw(const MessageAttachmentActions
const QStyleOptionViewItem &option) const
{
const ActionsLayout layout = layoutActions(act, option, messageRect.width());
+ painter->setRenderHint(QPainter::Antialiasing);
for (const auto &button : std::as_const(layout.buttonList)) {
// Draw button
const QPen origPen = painter->pen();
diff --git a/src/widgets/room/delegate/messagedelegatehelperactions.cpp b/src/widgets/room/delegate/messagedelegatehelperactions.cpp
index 2413149c77..0824a2b50b 100644
--- a/src/widgets/room/delegate/messagedelegatehelperactions.cpp
+++ b/src/widgets/room/delegate/messagedelegatehelperactions.cpp
@@ -37,6 +37,7 @@ void MessageDelegateHelperActions::draw(const Block &block,
{
Q_UNUSED(index)
const ActionsLayout layout = layoutActions(block, option, blockRect.width());
+ painter->setRenderHint(QPainter::Antialiasing);
for (const auto &button : std::as_const(layout.buttonList)) {
// Draw button
const QPen origPen = painter->pen();
diff --git a/src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp b/src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp
index 074c182555..3b9b537506 100644
--- a/src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp
+++ b/src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp
@@ -43,6 +43,7 @@ void MessageDelegateHelperConferenceVideo::draw(const Block &block,
{
Q_UNUSED(index)
const ConferenceCallLayout layout = layoutConferenceCall(block, option, blockRect.width());
+ painter->setRenderHint(QPainter::Antialiasing);
// Draw title and buttons
const int positionY = blockRect.y() + option.fontMetrics.ascent();
painter->drawText(blockRect.x(), positionY, layout.title);
diff --git a/src/widgets/room/delegate/messagedelegatehelperreactions.cpp b/src/widgets/room/delegate/messagedelegatehelperreactions.cpp
index 5011b0bd5e..d0c38f55ce 100644
--- a/src/widgets/room/delegate/messagedelegatehelperreactions.cpp
+++ b/src/widgets/room/delegate/messagedelegatehelperreactions.cpp
@@ -117,6 +117,8 @@ void MessageDelegateHelperReactions::draw(QPainter *painter, QRect reactionsRect
backgroundColor.setAlpha(60);
const QBrush buttonBrush(backgroundColor);
const qreal smallMargin = 4;
+ painter->setRenderHint(QPainter::Antialiasing);
+
for (const ReactionLayout &reactionLayout : layouts) {
Q_ASSERT(!reactionLayout.emojiString.isEmpty() || !reactionLayout.emojiImagePath.isEmpty());
const QRectF reactionRect = reactionLayout.reactionRect;
diff --git a/src/widgets/room/delegate/messagedelegatehelpersection.cpp b/src/widgets/room/delegate/messagedelegatehelpersection.cpp
index 32c4726532..840e253380 100644
--- a/src/widgets/room/delegate/messagedelegatehelpersection.cpp
+++ b/src/widgets/room/delegate/messagedelegatehelpersection.cpp
@@ -34,11 +34,11 @@ MessageDelegateHelperSection::~MessageDelegateHelperSection() = default;
void MessageDelegateHelperSection::draw(const Block &block,
QPainter *painter,
QRect blockRect,
- const QModelIndex &index,
+ [[maybe_unused]] const QModelIndex &index,
const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const SectionLayout layout = layoutSection(block, option, blockRect.width());
+ painter->setRenderHint(QPainter::Antialiasing);
// Draw title and buttons
const int positionY = blockRect.y() + option.fontMetrics.ascent();
painter->drawText(blockRect.x(), positionY, layout.sectionText);