mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-14 12:02:29 -04:00
corrected bug about wrong layout of friend list (patch from asamK)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4652 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
659814f156
commit
78955270e2
2 changed files with 20 additions and 17 deletions
|
@ -1425,22 +1425,28 @@ void FriendList::setHideStatusColumn(bool hidden)
|
|||
|
||||
void FriendList::setHideAvatarColumn(bool hidden)
|
||||
{
|
||||
if (mHideAvatarColumn != hidden) {
|
||||
QHeaderView *header = ui->peerTreeWidget->header();
|
||||
ui->peerTreeWidget->setColumnHidden(COLUMN_AVATAR, hidden);
|
||||
if (mHideAvatarColumn) { // if column was hidden
|
||||
if (header->sectionSize(COLUMN_NAME) > COLUMN_AVATAR_WIDTH) {
|
||||
// resize name column to make room for avatar column, but only if it doesn't result in negative width
|
||||
header->resizeSection(COLUMN_NAME, header->sectionSize(COLUMN_NAME) - COLUMN_AVATAR_WIDTH);
|
||||
}
|
||||
} else {
|
||||
header->resizeSection(COLUMN_NAME, header->sectionSize(COLUMN_NAME) + COLUMN_AVATAR_WIDTH);
|
||||
}
|
||||
if (mHideAvatarColumn == hidden)
|
||||
return;
|
||||
|
||||
mHideAvatarColumn = hidden;
|
||||
updateHeaderSizes();
|
||||
insertPeers();
|
||||
bool columnWasHidden = mHideAvatarColumn;
|
||||
mHideAvatarColumn = hidden;
|
||||
ui->peerTreeWidget->setColumnHidden(COLUMN_AVATAR, hidden);
|
||||
|
||||
if (RsAutoUpdatePage::eventsLocked()) // don't change header sizes
|
||||
return;
|
||||
|
||||
QHeaderView *header = ui->peerTreeWidget->header();
|
||||
if (columnWasHidden) {
|
||||
if (header->sectionSize(COLUMN_NAME) > COLUMN_AVATAR_WIDTH) {
|
||||
// resize name column to make room for avatar column, but only if it doesn't result in negative width
|
||||
header->resizeSection(COLUMN_NAME, header->sectionSize(COLUMN_NAME) - COLUMN_AVATAR_WIDTH);
|
||||
}
|
||||
} else {
|
||||
header->resizeSection(COLUMN_NAME, header->sectionSize(COLUMN_NAME) + COLUMN_AVATAR_WIDTH);
|
||||
}
|
||||
|
||||
updateHeaderSizes();
|
||||
insertPeers();
|
||||
}
|
||||
|
||||
void FriendList::setHideState(bool hidden)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue