use different constructor to more reliably set the parent for menus and actions

This may make rendering menus more stable on hi-dpi monitors.
It worked before, but sometimes it had some weird glitches.
This commit is contained in:
2022-08-28 12:00:10 +02:00
parent fd840a2c95
commit e405e908db
2 changed files with 4 additions and 2 deletions

View File

@@ -76,7 +76,8 @@ class RAction():
self._action.setText(label)
def to_qaction(self, qmenu: QMenu) -> QAction:
action = QAction(self.label, qmenu)
action = QAction(qmenu)
action.setText(self.label)
self._action = action
if self.icon_from_theme:
action.setIcon(Icon.fromTheme(self.icon_from_theme))