mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Make unread badges on top peers nicer.
This commit is contained in:
parent
4f365c73ad
commit
34a7169b4f
1 changed files with 11 additions and 2 deletions
|
@ -520,7 +520,7 @@ void TopPeersStrip::paintUserpic(
|
|||
const auto inner = QRect(0, 0, size, size);
|
||||
q.drawImage(inner, simple);
|
||||
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
auto hq = PainterHighQualityEnabler(q);
|
||||
|
||||
if (online > 0) {
|
||||
q.setCompositionMode(QPainter::CompositionMode_Source);
|
||||
|
@ -554,7 +554,16 @@ void TopPeersStrip::paintUserpic(
|
|||
st.selected = selected;
|
||||
st.muted = entry.muted;
|
||||
const auto &counter = entry.badgeString;
|
||||
PaintUnreadBadge(q, counter, size, 0, st);
|
||||
const auto badge = PaintUnreadBadge(q, counter, size, 0, st);
|
||||
|
||||
const auto width = style::ConvertScaleExact(2.);
|
||||
const auto add = (width - style::ConvertScaleExact(1.)) / 2.;
|
||||
auto pen = QPen(Qt::transparent);
|
||||
pen.setWidthF(width);
|
||||
q.setCompositionMode(QPainter::CompositionMode_Source);
|
||||
q.setPen(pen);
|
||||
q.setBrush(Qt::NoBrush);
|
||||
q.drawEllipse(QRectF(badge).marginsAdded({ add, add, add, add }));
|
||||
}
|
||||
|
||||
q.end();
|
||||
|
|
Loading…
Add table
Reference in a new issue