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:
parent
df50a875df
commit
de4f0272c1
@ -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 {
|
class TransferListFiltersWidget: public QFrame {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHash<QString, int> customLabels;
|
QHash<QString, int> customLabels;
|
||||||
QListWidget* statusFilters;
|
StatusFiltersWidget* statusFilters;
|
||||||
LabelFiltersList* labelFilters;
|
LabelFiltersList* labelFilters;
|
||||||
QVBoxLayout* vLayout;
|
QVBoxLayout* vLayout;
|
||||||
TransferListWidget *transferList;
|
TransferListWidget *transferList;
|
||||||
@ -160,7 +180,7 @@ public:
|
|||||||
TransferListFiltersWidget(QWidget *parent, TransferListWidget *transferList): QFrame(parent), transferList(transferList), nb_labeled(0), nb_torrents(0) {
|
TransferListFiltersWidget(QWidget *parent, TransferListWidget *transferList): QFrame(parent), transferList(transferList), nb_labeled(0), nb_torrents(0) {
|
||||||
// Construct lists
|
// Construct lists
|
||||||
vLayout = new QVBoxLayout();
|
vLayout = new QVBoxLayout();
|
||||||
statusFilters = new QListWidget(this);
|
statusFilters = new StatusFiltersWidget(this);
|
||||||
vLayout->addWidget(statusFilters);
|
vLayout->addWidget(statusFilters);
|
||||||
labelFilters = new LabelFiltersList(this);
|
labelFilters = new LabelFiltersList(this);
|
||||||
vLayout->addWidget(labelFilters);
|
vLayout->addWidget(labelFilters);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user