mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-23 06:35:24 -07:00
Fix possible status filters widget height problem
This commit is contained in:
parent
7bd7ecc77d
commit
41331af3c6
3 changed files with 9 additions and 28 deletions
|
@ -1,6 +1,7 @@
|
|||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.8.2
|
||||
- BUGFIX: Fix tracker exchange advanced setting
|
||||
- BUGFIX: Fix Proxy authentication settings
|
||||
- BUGFIX: Fix possible status filters widget height problem
|
||||
|
||||
* Sun Jun 05 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.8.1
|
||||
- BUGFIX: Fix Web UI username/password change (Web UI)
|
||||
|
|
|
@ -711,9 +711,6 @@ void MainWindow::on_actionAbout_triggered() {
|
|||
void MainWindow::showEvent(QShowEvent *e) {
|
||||
qDebug("** Show Event **");
|
||||
|
||||
// Update status filters list height
|
||||
transferListFilters->getStatusFilters()->updateHeight();
|
||||
|
||||
if(getCurrentTabWidget() == transferList) {
|
||||
properties->loadDynamicData();
|
||||
}
|
||||
|
|
|
@ -154,35 +154,18 @@ class StatusFiltersWidget : public QListWidget {
|
|||
|
||||
public:
|
||||
StatusFiltersWidget(QWidget *parent) : QListWidget(parent), m_shown(false) {
|
||||
//setFixedHeight(120);
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
|
||||
}
|
||||
|
||||
public slots:
|
||||
void updateHeight() {
|
||||
qDebug("Adjusting statuslist widget height...");
|
||||
m_shown = true;
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
int cur_height = 50;
|
||||
do {
|
||||
setFixedHeight(cur_height);
|
||||
cur_height += 10;
|
||||
}while(verticalScrollBar()->isVisible());
|
||||
setUniformItemSizes(true);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
// Height is fixed (sizeHint().height() is used)
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
}
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e) {
|
||||
QListWidget::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::StyleChange:
|
||||
qDebug("Style has changed, adapting the statusfilters widget height");
|
||||
if(m_shown)
|
||||
updateHeight();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
QSize sizeHint() const {
|
||||
QSize size = QListWidget::sizeHint();
|
||||
// Height should be exactly the height of the content
|
||||
size.setHeight(contentsSize().height() + 2 * frameWidth());
|
||||
return size;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue