mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-29 11:12:59 +02:00
Do not layout hidden widgets
This commit is contained in:
parent
81ea515070
commit
a11488322b
1 changed files with 5 additions and 3 deletions
|
|
@ -381,6 +381,8 @@ def layout_spacing(wid, horizontal=True):
|
|||
gmap = {}
|
||||
for item in self.items:
|
||||
isz, wid = item.sizeHint(), item.widget()
|
||||
if isz.isEmpty() or (wid is not None and not wid.isVisible()):
|
||||
continue
|
||||
hs, vs = layout_spacing(wid), layout_spacing(wid, False)
|
||||
|
||||
next_x = x + isz.width() + hs
|
||||
|
|
@ -402,10 +404,10 @@ def layout_spacing(wid, horizontal=True):
|
|||
if apply_geometry:
|
||||
for line_height, items in lines:
|
||||
for item, item_height in items:
|
||||
x, y, isz = gmap[item]
|
||||
x, wy, isz = gmap[item]
|
||||
if item_height < line_height:
|
||||
y += (line_height - item_height) // 2
|
||||
item.setGeometry(QRect(QPoint(x, y), isz))
|
||||
wy += (line_height - item_height) // 2
|
||||
item.setGeometry(QRect(QPoint(x, wy), isz))
|
||||
|
||||
return y + line_height - rect.y() + bottom
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue