Fix height calculation of download view.
This commit is contained in:
parent
b899d8b44d
commit
888a17b7c3
@ -132,9 +132,12 @@ class DownloadView(QListView):
|
|||||||
def sizeHint(self):
|
def sizeHint(self):
|
||||||
"""Return sizeHint based on the view contents."""
|
"""Return sizeHint based on the view contents."""
|
||||||
idx = self.model().last_index()
|
idx = self.model().last_index()
|
||||||
height = self.visualRect(idx).bottom()
|
bottom = self.visualRect(idx).bottom()
|
||||||
if height != -1:
|
if bottom != -1:
|
||||||
size = QSize(0, height + 2)
|
margins = self.contentsMargins()
|
||||||
|
height = (bottom + margins.top() + margins.bottom() +
|
||||||
|
2 * self.spacing())
|
||||||
|
size = QSize(0, height)
|
||||||
else:
|
else:
|
||||||
size = QSize(0, 0)
|
size = QSize(0, 0)
|
||||||
qtutils.ensure_valid(size)
|
qtutils.ensure_valid(size)
|
||||||
|
Loading…
Reference in New Issue
Block a user