Browse Source

Correct redraw after filtering

fix #1757
It looks a bit strange, but a redraw on another call fails. Moreover, order calling functions radically changes the behavior of the widget
pull/1769/head
PKev 10 years ago committed by PKEv
parent
commit
98819df90c
  1. 8
      src/widget/friendlistwidget.cpp
  2. 2
      src/widget/friendlistwidget.h
  3. 9
      src/widget/widget.cpp

8
src/widget/friendlistwidget.cpp

@ -130,3 +130,11 @@ void FriendListWidget::moveWidget(QWidget *w, Status s)
} }
l->addWidget(w); l->addWidget(w);
} }
// update widget after add/delete/hide/show
void FriendListWidget::reDraw()
{
hide();
show();
resize(QSize()); //lifehack
}

2
src/widget/friendlistwidget.h

@ -34,7 +34,7 @@ public:
QVBoxLayout* getFriendLayout(Status s); QVBoxLayout* getFriendLayout(Status s);
QList<GenericChatroomWidget*> getAllFriends(); QList<GenericChatroomWidget*> getAllFriends();
void reDraw();
signals: signals:
public slots: public slots:

9
src/widget/widget.cpp

@ -889,8 +889,7 @@ void Widget::removeFriend(Friend* f, bool fake)
if (ui->mainHead->layout()->isEmpty()) if (ui->mainHead->layout()->isEmpty())
onAddClicked(); onAddClicked();
contactListWidget->hide(); contactListWidget->reDraw();
contactListWidget->show();
} }
void Widget::removeFriend(int friendId) void Widget::removeFriend(int friendId)
@ -1040,8 +1039,7 @@ void Widget::removeGroup(Group* g, bool fake)
if (ui->mainHead->layout()->isEmpty()) if (ui->mainHead->layout()->isEmpty())
onAddClicked(); onAddClicked();
contactListWidget->hide(); contactListWidget->reDraw();
contactListWidget->show();
} }
void Widget::removeGroup(int groupId) void Widget::removeGroup(int groupId)
@ -1445,8 +1443,7 @@ void Widget::searchContacts()
return; return;
} }
contactListWidget->hide(); contactListWidget->reDraw();
contactListWidget->show();
} }
void Widget::hideFriends(QString searchString, Status status, bool hideAll) void Widget::hideFriends(QString searchString, Status status, bool hideAll)

Loading…
Cancel
Save