1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 21:14:33 +00:00

Add space between widgets in left side panel. Closes #7224.

This commit is contained in:
Chocobo1 2017-08-11 13:09:31 +08:00
parent 6f0d16bca5
commit 04552f7921
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
3 changed files with 18 additions and 8 deletions

View File

@ -168,7 +168,12 @@ void CategoryFilterWidget::callUpdateGeometry()
QSize CategoryFilterWidget::sizeHint() const
{
return viewportSizeHint();
return {
// Width should be exactly the width of the content
sizeHintForColumn(0),
// Height should be exactly the height of the content
static_cast<int>(sizeHintForRow(0) * (model()->rowCount() + 0.5)),
};
}
QSize CategoryFilterWidget::minimumSizeHint() const

View File

@ -156,7 +156,12 @@ void TagFilterWidget::callUpdateGeometry()
QSize TagFilterWidget::sizeHint() const
{
return viewportSizeHint();
return {
// Width should be exactly the width of the content
sizeHintForColumn(0),
// Height should be exactly the height of the content
static_cast<int>(sizeHintForRow(0) * (model()->rowCount() + 0.5)),
};
}
QSize TagFilterWidget::minimumSizeHint() const

View File

@ -89,12 +89,12 @@ FiltersBase::FiltersBase(QWidget *parent, TransferListWidget *transferList)
QSize FiltersBase::sizeHint() const
{
QSize size;
// Height should be exactly the height of the content
size.setHeight(((sizeHintForRow(0) + 2 * spacing()) * (count() + 0.5)));
// Width should be exactly the width of the content
size.setWidth(sizeHintForColumn(0));
return size;
return {
// Width should be exactly the width of the content
sizeHintForColumn(0),
// Height should be exactly the height of the content
static_cast<int>((sizeHintForRow(0) + 2 * spacing()) * (count() + 0.5)),
};
}
QSize FiltersBase::minimumSizeHint() const