[network/ruqola] src/widgets/room: Use alpha
Laurent Montel <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 556f49e32422ae156befd92dc52e84e2b0510bdf by Laurent Montel.
Committed on 14/08/2026 at 17:40.
Pushed by mlaurent into branch 'master'.
Use alpha
M +1 -1 src/widgets/room/delegate/messagelistdelegate.cpp
M +5 -1 src/widgets/room/selectedmessagebackgroundanimation.cpp
https://invent.kde.org/network/ruqola/-/commit/556f49e32422ae156befd92dc52e84e2b0510bdf
diff --git a/src/widgets/room/delegate/messagelistdelegate.cpp b/src/widgets/room/delegate/messagelistdelegate.cpp
index e650b063d1..72a62a5f6b 100644
--- a/src/widgets/room/delegate/messagelistdelegate.cpp
+++ b/src/widgets/room/delegate/messagelistdelegate.cpp
@@ -529,7 +529,7 @@ void MessageListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
}
if (message->textToSpeechInProgress()) {
painter->fillRect(option.rect, mTextToSpeechInProgressColor);
- } else if (goToMessageBackgroundColor.isValid() && goToMessageBackgroundColor != QColor(Qt::transparent)) {
+ } else if (goToMessageBackgroundColor.isValid() && goToMessageBackgroundColor.alpha() != 0) {
painter->fillRect(option.rect, goToMessageBackgroundColor);
} else if (message->isEditingMode()) {
painter->fillRect(option.rect, mEditColorMode);
diff --git a/src/widgets/room/selectedmessagebackgroundanimation.cpp b/src/widgets/room/selectedmessagebackgroundanimation.cpp
index 95170e6279..0152f105a8 100644
--- a/src/widgets/room/selectedmessagebackgroundanimation.cpp
+++ b/src/widgets/room/selectedmessagebackgroundanimation.cpp
@@ -47,8 +47,12 @@ void SelectedMessageBackgroundAnimation::start()
auto animation = new QPropertyAnimation(this, "backgroundColor"_ba, this);
animation->setDuration(2000);
const auto color = ColorsAndMessageViewStyle::self().schemeView().foreground(KColorScheme::NeutralText).color();
+ // Fade out the alpha channel only: interpolating towards Qt::transparent (transparent black)
+ // would drag the rgb channels to black and darken the highlight instead of dissolving it.
+ QColor endColor = color;
+ endColor.setAlpha(0);
animation->setStartValue(color);
- animation->setEndValue(QColor(Qt::transparent));
+ animation->setEndValue(endColor);
animation->setEasingCurve(QEasingCurve::InOutQuad);
animation->start();
connect(animation, &QPropertyAnimation::finished, this, [this]() {