1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 20:44:15 +00:00

Make sure status filters height is correct when the visual style changes

This commit is contained in:
Christophe Dumez 2010-04-17 14:21:19 +00:00
parent df50a875df
commit de4f0272c1

View File

@ -144,12 +144,32 @@ protected:
}
};
class StatusFiltersWidget : public QListWidget {
public:
StatusFiltersWidget(QWidget *parent) : QListWidget(parent) {
setFixedHeight(100);
}
protected:
void changeEvent(QEvent *e) {
QListWidget::changeEvent(e);
switch (e->type()) {
case QEvent::StyleChange:
setSpacing(0);
setFixedHeight(100);
break;
default:
break;
}
}
};
class TransferListFiltersWidget: public QFrame {
Q_OBJECT
private:
QHash<QString, int> customLabels;
QListWidget* statusFilters;
StatusFiltersWidget* statusFilters;
LabelFiltersList* labelFilters;
QVBoxLayout* vLayout;
TransferListWidget *transferList;
@ -160,7 +180,7 @@ public:
TransferListFiltersWidget(QWidget *parent, TransferListWidget *transferList): QFrame(parent), transferList(transferList), nb_labeled(0), nb_torrents(0) {
// Construct lists
vLayout = new QVBoxLayout();
statusFilters = new QListWidget(this);
statusFilters = new StatusFiltersWidget(this);
vLayout->addWidget(statusFilters);
labelFilters = new LabelFiltersList(this);
vLayout->addWidget(labelFilters);