mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 01:16:20 -05: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
@ -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)
|
||||
|
@ -66,9 +66,6 @@
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Friends</string>
|
||||
|
Loading…
Reference in New Issue
Block a user