Browse Source

- Fix to make sure that the filters list height is always sufficient to display all the filters (without the need for a scrollbar)

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
396da6bd94
  1. 9
      src/GUI.cpp
  2. 8
      src/transferlistfilterswidget.h

9
src/GUI.cpp

@ -188,6 +188,15 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis @@ -188,6 +188,15 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
readSettings();
properties->readSettings();
// Limit status filters list height
int cur_height = 80;
do {
transferListFilters->getStatusFilters()->setFixedHeight(cur_height);
cur_height += 10;
transferListFilters->getStatusFilters()->scrollToBottom();
}while(transferListFilters->getStatusFilters()->verticalScrollBar()->sliderPosition() > 0);
transferListFilters->getStatusFilters()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
if(Preferences::startMinimized()) {
setWindowState(Qt::WindowMinimized);
}

8
src/transferlistfilterswidget.h

@ -167,10 +167,8 @@ public: @@ -167,10 +167,8 @@ public:
labelFilters = new LabelFiltersList(this);
vLayout->addWidget(labelFilters);
setLayout(vLayout);
// Limit status filters list height
statusFilters->setFixedHeight(100);
labelFilters->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
statusFilters->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
statusFilters->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
statusFilters->setSpacing(0);
setContentsMargins(0,0,0,0);
vLayout->setSpacing(2);
@ -226,6 +224,10 @@ public: @@ -226,6 +224,10 @@ public:
delete vLayout;
}
QListWidget* getStatusFilters() const {
return statusFilters;
}
void saveSettings() const {
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
settings.beginGroup(QString::fromUtf8("TransferListFilters"));

Loading…
Cancel
Save