Skip to content

Commit fd3b9fa

Browse files
committed
overlay: Ensure overlay is properly positioned on show event
1 parent 6a4b00d commit fd3b9fa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Orange/widgets/utils/overlay.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Overlay Message Widget
33
----------------------
44
5-
A Widget to display a temporary dismissable message over another widget.
5+
A Widget to display a temporary dismissible message over another widget.
66
77
"""
88

@@ -102,6 +102,11 @@ def paintEvent(self, event):
102102
painter = QPainter(self)
103103
self.style().drawPrimitive(QStyle.PE_Widget, opt, painter, self)
104104

105+
def showEvent(self, event):
106+
super().showEvent(event)
107+
# Force immediate re-layout on show
108+
self.__layout()
109+
105110
def __layout(self):
106111
# position itself over `widget`
107112
# pylint: disable=too-many-branches
@@ -469,7 +474,7 @@ def buttonRole(self, button):
469474
"""
470475
Return the ButtonRole for button
471476
472-
:type button: QAbsstractButton
477+
:type button: QAbstractButton
473478
"""
474479
for slot in self.__buttons:
475480
if slot.button is button:

0 commit comments

Comments
 (0)