2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Display online count in the info profile section.

This commit is contained in:
John Preston
2017-10-22 15:07:57 +03:00
parent 508fa14385
commit 856ca22aad
13 changed files with 229 additions and 45 deletions

View File

@@ -88,6 +88,10 @@ int Members::desiredHeight() const {
return qMax(height(), desired);
}
rpl::producer<int> Members::onlineCountValue() const {
return _listController->onlineCountValue();
}
object_ptr<Ui::FlatLabel> Members::setupHeader() {
auto result = object_ptr<Ui::FlatLabel>(
_labelWrap,
@@ -183,7 +187,9 @@ object_ptr<Members::ListWidget> Members::setupList(
result->heightValue()
| rpl::start_with_next([parent](int listHeight) {
auto newHeight = (listHeight > st::membersMarginBottom)
? (st::infoMembersHeader + listHeight)
? (st::infoMembersHeader
+ listHeight
+ st::membersMarginBottom)
: 0;
parent->resize(parent->width(), newHeight);
}, result->lifetime());