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
readSettings(); readSettings();
properties->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()) { if(Preferences::startMinimized()) {
setWindowState(Qt::WindowMinimized); setWindowState(Qt::WindowMinimized);
} }

8
src/transferlistfilterswidget.h

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

Loading…
Cancel
Save