From 396da6bd94f41818981b6c1692a328397659b986 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 17 Jan 2010 21:27:08 +0000 Subject: [PATCH] - Fix to make sure that the filters list height is always sufficient to display all the filters (without the need for a scrollbar) --- src/GUI.cpp | 9 +++++++++ src/transferlistfilterswidget.h | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/GUI.cpp b/src/GUI.cpp index ca8ed48f2..4996bb9e6 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -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); } diff --git a/src/transferlistfilterswidget.h b/src/transferlistfilterswidget.h index 13cfe1891..bfa66eaf3 100644 --- a/src/transferlistfilterswidget.h +++ b/src/transferlistfilterswidget.h @@ -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: delete vLayout; } + QListWidget* getStatusFilters() const { + return statusFilters; + } + void saveSettings() const { QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); settings.beginGroup(QString::fromUtf8("TransferListFilters"));