2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Paint expanded topics indicator.

This commit is contained in:
John Preston
2022-11-30 13:57:00 +04:00
parent 823bbb1b77
commit 188c6ba64a
3 changed files with 25 additions and 0 deletions

View File

@@ -546,6 +546,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
auto fullWidth = width();
auto dialogsClip = r;
const auto ms = crl::now();
const auto shownForum = _controller->shownForum().current();
const auto paintRow = [&](
not_null<Row*> row,
bool selected,
@@ -557,6 +558,10 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
if (forum && !_topicJumpCache) {
_topicJumpCache = std::make_unique<Ui::TopicJumpCache>();
}
const auto expanded = !active
&& forum
&& !_openedForum
&& (key.history()->peer->forum() == shownForum);
Ui::RowPainter::Paint(p, row, validateVideoUserpic(row), {
.st = (forum ? &st::forumDialogRow : _st.get()),
.topicJumpCache = _topicJumpCache.get(),
@@ -569,6 +574,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
.selected = (_menuRow.key
? (row->key() == _menuRow.key)
: selected),
.topicsExpanded = expanded,
.topicJumpSelected = (selected
&& _selectedTopicJump
&& (!_pressed || _pressedTopicJump)),