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,10 +1425,18 @@ void FriendList::setHideStatusColumn(bool hidden)
|
||||
|
||||
void FriendList::setHideAvatarColumn(bool hidden)
|
||||
{
|
||||
if (mHideAvatarColumn != hidden) {
|
||||
QHeaderView *header = ui->peerTreeWidget->header();
|
||||
if (mHideAvatarColumn == hidden)
|
||||
return;
|
||||
|
||||
bool columnWasHidden = mHideAvatarColumn;
|
||||
mHideAvatarColumn = hidden;
|
||||
ui->peerTreeWidget->setColumnHidden(COLUMN_AVATAR, hidden);
|
||||
if (mHideAvatarColumn) { // if column was 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);
|
||||
@ -1437,11 +1445,9 @@ void FriendList::setHideAvatarColumn(bool hidden)
|
||||
header->resizeSection(COLUMN_NAME, header->sectionSize(COLUMN_NAME) + COLUMN_AVATAR_WIDTH);
|
||||
}
|
||||
|
||||
mHideAvatarColumn = hidden;
|
||||
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