summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtChatOverviewBundle.cpp')
-rw-r--r--Swift/QtUI/QtChatOverviewBundle.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/Swift/QtUI/QtChatOverviewBundle.cpp b/Swift/QtUI/QtChatOverviewBundle.cpp
index bf99b0c..8505541 100644
--- a/Swift/QtUI/QtChatOverviewBundle.cpp
+++ b/Swift/QtUI/QtChatOverviewBundle.cpp
@@ -11,3 +11,2 @@
#include <QLabel>
-#include <QListView>
#include <QPalette>
@@ -21,2 +20,3 @@
#include <Swift/QtUI/QtClickableLabel.h>
+#include <Swift/QtUI/QtExpandedListView.h>
#include <Swift/QtUI/QtSwiftUtil.h>
@@ -102,3 +102,3 @@ QtChatOverviewBundle::QtChatOverviewBundle(ChattablesModel* rootModel, QString n
}
- listView_ = new QListView(this);
+ listView_ = new QtExpandedListView(this);
listView_->setModel(proxyModel_);
@@ -107,7 +107,3 @@ QtChatOverviewBundle::QtChatOverviewBundle(ChattablesModel* rootModel, QString n
connect(listView_, SIGNAL(clicked(const QModelIndex&)), this, SLOT(handleItemClicked(const QModelIndex&)));
- recalculateSize();
mainLayout->addWidget(listView_);
- connect(proxyModel_, SIGNAL(rowsInserted(const QModelIndex&, int, int)), this, SLOT(recalculateSize()));
- connect(proxyModel_, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), this, SLOT(recalculateSize()));
- connect(proxyModel_, SIGNAL(modelReset()), this, SLOT(recalculateSize()));
}
@@ -116,16 +112,2 @@ QtChatOverviewBundle::~QtChatOverviewBundle() {}
-void QtChatOverviewBundle::recalculateSize() {
- int totalHeight = 0;
- for (int i = 0; i < proxyModel_->rowCount(); i++) {
- totalHeight += listView_->sizeHintForRow(i);
- }
- listView_->setFixedHeight(totalHeight);
- if (hideWhenEmpty_ && totalHeight == 0) {
- hide();
- }
- else {
- show();
- }
-}
-
void QtChatOverviewBundle::handleFilterClicked() {