music player glitch fixed, added phrase about the members viewing in channels

This commit is contained in:
John Preston 2015-12-06 19:28:07 +03:00
parent 128cbefe0c
commit 485a6b551f
4 changed files with 22 additions and 2 deletions

View File

@ -431,6 +431,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
"lng_channel_add_admins" = "New administrator";
"lng_channel_add_members" = "Add members";
"lng_channel_members" = "Members";
"lng_channel_only_last_shown" = "Only last {count:_not_used_|# member|# members} are shown here";
"lng_channel_admins" = "Administrators";
"lng_channel_add_admin" = "Add Administrator";
"lng_channel_admin_sure" = "Add {user} to administrators?";

View File

@ -1773,7 +1773,10 @@ MembersInner::MembersInner(ChannelData *channel, MembersFilter filter) : TWidget
, _kickRequestId(0)
, _kickBox(0)
, _loading(true)
, _loadingRequestId(0) {
, _loadingRequestId(0)
, _aboutWidth(st::boxWideWidth - st::contactsPadding.left() - st::contactsPhotoSize - st::contactsPadding.left() - st::contactsPadding.right())
, _about(_aboutWidth)
, _aboutHeight(0) {
connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(update()));
connect(App::main(), SIGNAL(peerNameChanged(PeerData*, const PeerData::Names&, const PeerData::NameFirstChars&)), this, SLOT(onPeerNameChanged(PeerData*, const PeerData::Names&, const PeerData::NameFirstChars&)));
connect(App::main(), SIGNAL(peerPhotoChanged(PeerData*)), this, SLOT(peerUpdated(PeerData*)));
@ -1824,6 +1827,10 @@ void MembersInner::paintEvent(QPaintEvent *e) {
paintDialog(p, _rows[from], data(from), sel, kickSel, kickDown);
p.translate(0, _rowHeight);
}
if (to == _rows.size() && (_rows.size() < _channel->count || _rows.size() >= cMaxGroupCount())) {
p.setPen(st::stickersReorderFg);
_about.drawLeft(p, st::contactsPadding.left() + st::contactsPhotoSize + st::contactsPadding.left(), st::stickersReorderPadding.top(), _aboutWidth, width());
}
}
}
@ -1995,8 +2002,14 @@ void MembersInner::chooseParticipant() {
void MembersInner::refresh() {
if (_rows.isEmpty()) {
resize(width(), st::membersPadding.top() + st::noContactsHeight + st::membersPadding.bottom());
_aboutHeight = 0;
} else {
resize(width(), st::membersPadding.top() + _newItemHeight + _rows.size() * _rowHeight + st::membersPadding.bottom());
_about.setText(st::boxTextFont, lng_channel_only_last_shown(lt_count, _rows.size()));
_aboutHeight = st::stickersReorderPadding.top() + _about.countHeight(_aboutWidth) + st::stickersReorderPadding.bottom();
if (_rows.size() >= _channel->count && _rows.size() < cMaxGroupCount()) {
_aboutHeight = 0;
}
resize(width(), st::membersPadding.top() + _newItemHeight + _rows.size() * _rowHeight + st::membersPadding.bottom() + _aboutHeight);
}
update();
}

View File

@ -386,6 +386,10 @@ private:
MemberRoles _roles;
MemberDatas _datas;
int32 _aboutWidth;
Text _about;
int32 _aboutHeight;
QPoint _lastMousePos;
};

View File

@ -2716,6 +2716,7 @@ void MainWidget::hideAll() {
_topBar.hide();
_mediaType.hide();
_player.hide();
_playerHeight = 0;
}
void MainWidget::showAll() {
@ -2790,6 +2791,7 @@ void MainWidget::showAll() {
}
}
}
resizeEvent(0);
App::wnd()->checkHistoryActivation();
}