2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Animate child topics list open / close.

This commit is contained in:
John Preston
2022-12-01 17:48:33 +04:00
parent 468d01fc1a
commit 32491ead5e
8 changed files with 224 additions and 58 deletions

View File

@@ -186,17 +186,18 @@ int PaintBadges(
return (initial - right);
}
void PaintExpandedTopicsBar(QPainter &p) {
void PaintExpandedTopicsBar(QPainter &p, float64 progress) {
auto hq = PainterHighQualityEnabler(p);
const auto radius = st::roundRadiusLarge;
const auto width = st::forumDialogRow.padding.left() / 2;
p.setPen(Qt::NoPen);
p.setBrush(st::dialogsBgActive);
p.drawRoundedRect(
-3 * radius,
st::forumDialogRow.padding.top(),
3 * radius + width,
st::forumDialogRow.photoSize,
QRectF(
-3. * radius - width * (1. - progress),
st::forumDialogRow.padding.top(),
3. * radius + width,
st::forumDialogRow.photoSize),
radius,
radius);
}
@@ -349,13 +350,13 @@ void PaintRow(
}
auto nameleft = context.st->nameLeft;
if (context.topicsExpanded > 0.) {
PaintExpandedTopicsBar(p, context.topicsExpanded);
}
if (context.narrow) {
if (!draft && item && !item->isEmpty()) {
PaintNarrowCounter(p, context, badgesState);
}
if (context.topicsExpanded) {
PaintExpandedTopicsBar(p);
}
return;
}