Merge pull request #553 from HashSplat/legend_remove_item_size

Fixed legend size after remove item
This commit is contained in:
Luke Campagnola 2018-03-29 19:04:24 -07:00 committed by GitHub
commit b421cc2790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,7 +110,8 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
#print("-------")
for sample, label in self.items:
height += max(sample.height(), label.height()) + 3
width = max(width, sample.width()+label.width())
width = max(width, (sample.sizeHint(QtCore.Qt.MinimumSize, sample.size()).width() +
label.sizeHint(QtCore.Qt.MinimumSize, label.size()).width()))
#print(width, height)
#print width, height
self.setGeometry(0, 0, width+25, height)