|
|
@ -42,6 +42,7 @@ |
|
|
|
#include <QStandardItemModel> |
|
|
|
#include <QStandardItemModel> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QScrollBar> |
|
|
|
#include <QScrollBar> |
|
|
|
|
|
|
|
#include <QLabel> |
|
|
|
|
|
|
|
|
|
|
|
#include "transferlistdelegate.h" |
|
|
|
#include "transferlistdelegate.h" |
|
|
|
#include "transferlistwidget.h" |
|
|
|
#include "transferlistwidget.h" |
|
|
@ -63,6 +64,8 @@ public: |
|
|
|
// Accept drop
|
|
|
|
// Accept drop
|
|
|
|
setAcceptDrops(true); |
|
|
|
setAcceptDrops(true); |
|
|
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); |
|
|
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); |
|
|
|
|
|
|
|
setAttribute(Qt::WA_NoSystemBackground, true); |
|
|
|
|
|
|
|
setStyleSheet("background: transparent"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Redefine addItem() to make sure the list stays sorted
|
|
|
|
// Redefine addItem() to make sure the list stays sorted
|
|
|
@ -159,13 +162,14 @@ public: |
|
|
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); |
|
|
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); |
|
|
|
// Height is fixed (sizeHint().height() is used)
|
|
|
|
// Height is fixed (sizeHint().height() is used)
|
|
|
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); |
|
|
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); |
|
|
|
|
|
|
|
setStyleSheet("background: transparent"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected: |
|
|
|
protected: |
|
|
|
QSize sizeHint() const { |
|
|
|
QSize sizeHint() const { |
|
|
|
QSize size = QListWidget::sizeHint(); |
|
|
|
QSize size = QListWidget::sizeHint(); |
|
|
|
// Height should be exactly the height of the content
|
|
|
|
// Height should be exactly the height of the content
|
|
|
|
size.setHeight(contentsSize().height() + 2 * frameWidth()); |
|
|
|
size.setHeight(contentsSize().height() + 2 * frameWidth()+6); |
|
|
|
return size; |
|
|
|
return size; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -191,9 +195,20 @@ public: |
|
|
|
// Construct lists
|
|
|
|
// Construct lists
|
|
|
|
vLayout = new QVBoxLayout(); |
|
|
|
vLayout = new QVBoxLayout(); |
|
|
|
vLayout->setContentsMargins(0, 4, 0, 4); |
|
|
|
vLayout->setContentsMargins(0, 4, 0, 4); |
|
|
|
|
|
|
|
QFont font; |
|
|
|
|
|
|
|
font.setBold(true); |
|
|
|
|
|
|
|
font.setCapitalization(QFont::SmallCaps); |
|
|
|
|
|
|
|
QLabel *torrentsLabel = new QLabel(tr("Torrents")); |
|
|
|
|
|
|
|
torrentsLabel->setIndent(2); |
|
|
|
|
|
|
|
torrentsLabel->setFont(font); |
|
|
|
|
|
|
|
vLayout->addWidget(torrentsLabel); |
|
|
|
statusFilters = new StatusFiltersWidget(this); |
|
|
|
statusFilters = new StatusFiltersWidget(this); |
|
|
|
vLayout->addWidget(statusFilters); |
|
|
|
vLayout->addWidget(statusFilters); |
|
|
|
statusFilters->setFocusPolicy(Qt::NoFocus); |
|
|
|
statusFilters->setFocusPolicy(Qt::NoFocus); |
|
|
|
|
|
|
|
QLabel *labelsLabel = new QLabel(tr("Labels")); |
|
|
|
|
|
|
|
labelsLabel->setIndent(2); |
|
|
|
|
|
|
|
labelsLabel->setFont(font); |
|
|
|
|
|
|
|
vLayout->addWidget(labelsLabel); |
|
|
|
labelFilters = new LabelFiltersList(this); |
|
|
|
labelFilters = new LabelFiltersList(this); |
|
|
|
vLayout->addWidget(labelFilters); |
|
|
|
vLayout->addWidget(labelFilters); |
|
|
|
labelFilters->setFocusPolicy(Qt::NoFocus); |
|
|
|
labelFilters->setFocusPolicy(Qt::NoFocus); |
|
|
|