Skip to content

Commit

Permalink
music player glitch fixed, added phrase about the members viewing in …
Browse files Browse the repository at this point in the history
…channels
  • Loading branch information
john-preston committed Dec 6, 2015
1 parent 128cbef commit 485a6b5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions Telegram/Resources/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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?";
Expand Down
17 changes: 15 additions & 2 deletions Telegram/SourceFiles/boxes/contactsbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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*)));
Expand Down Expand Up @@ -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());
}
}
}

Expand Down Expand Up @@ -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();
}
Expand Down
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/boxes/contactsbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ public slots:
MemberRoles _roles;
MemberDatas _datas;

int32 _aboutWidth;
Text _about;
int32 _aboutHeight;

QPoint _lastMousePos;

};
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/mainwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2716,6 +2716,7 @@ void MainWidget::hideAll() {
_topBar.hide();
_mediaType.hide();
_player.hide();
_playerHeight = 0;
}

void MainWidget::showAll() {
Expand Down Expand Up @@ -2790,6 +2791,7 @@ void MainWidget::showAll() {
}
}
}
resizeEvent(0);

App::wnd()->checkHistoryActivation();
}
Expand Down

0 comments on commit 485a6b5

Please sign in to comment.