make paused chat indicator more apparent (#6123)

This commit is contained in:
Jacob Alexander Thompson
2025-04-05 13:53:30 -07:00
committed by GitHub
parent c5b6f21d5f
commit 3481c93365
2 changed files with 32 additions and 4 deletions
+1
View File
@@ -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)
+31 -4
View File
@@ -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);
}
}