Merge pull request #553 from HashSplat/legend_remove_item_size
Fixed legend size after remove item
This commit is contained in:
commit
b421cc2790
@ -110,7 +110,8 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
|
|||||||
#print("-------")
|
#print("-------")
|
||||||
for sample, label in self.items:
|
for sample, label in self.items:
|
||||||
height += max(sample.height(), label.height()) + 3
|
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)
|
||||||
#print width, height
|
#print width, height
|
||||||
self.setGeometry(0, 0, width+25, height)
|
self.setGeometry(0, 0, width+25, height)
|
||||||
|
Loading…
Reference in New Issue
Block a user