diff --git a/CHANGELOG.md b/CHANGELOG.md index a40f4c5e..323bf2c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unversioned +- Minor: Make paused chat indicator more visible, and fix its zoom behavior. (#6123) - Bugfix: Don't create native messaging manifest file if browser directory doesn't exist. (#6116) - Bugfix: Make reply-cancel button less coarse-grained. (#6106) - Dev: Conan will no longer generate a `CMakeUserPresets.json` file. (#6117) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index b3e14eaa..99f168f5 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1548,10 +1548,37 @@ void ChannelView::paintEvent(QPaintEvent *event) // draw paused sign if (this->paused()) { - auto a = this->scale() * 20; - auto brush = QBrush(QColor(127, 127, 127, 255)); - painter.fillRect(QRectF(5, a / 4, a / 4, a), brush); - painter.fillRect(QRectF(15, a / 4, a / 4, a), brush); + auto baseSize = 20; + auto scale = this->scale(); + auto indicatorSize = baseSize * scale; + auto color = QColor(180, 180, 180, 255); + auto brush = QBrush(color); + + const auto pausedY = indicatorSize / 4; + const auto pausedX = 5 * scale; + + QFont font = painter.font(); + font.setPixelSize(indicatorSize); + painter.setFont(font); + + const QString text = "Paused"; + const QFontMetrics metrics(font); + const auto textWidth = metrics.horizontalAdvance(text); + const auto textX = pausedX * 3 + 10 * scale; + + painter.fillRect(QRectF(0, 0, pausedX + textX + textWidth, + indicatorSize / 2 + indicatorSize), + QBrush(QColor(0, 0, 0, 200), Qt::SolidPattern)); + + painter.fillRect( + QRectF(pausedX, pausedY, indicatorSize / 4, indicatorSize), brush); + painter.fillRect( + QRectF(pausedX * 3, pausedY, indicatorSize / 4, indicatorSize), + brush); + + painter.setPen(color); + painter.drawText(QRectF(textX, pausedY, textWidth, indicatorSize), + Qt::AlignLeft | Qt::AlignVCenter, text); } }