Action for toggling always on top mode

This commit is contained in:
Rebecca Breu 2021-04-18 16:39:27 +02:00
parent 0d85eb3473
commit ff073445af
3 changed files with 14 additions and 0 deletions

View file

@ -194,4 +194,10 @@ actions = [
'checkable': True,
'callback': 'on_action_fullscreen',
},
{
'id': 'always_on_top',
'text': '&Always On Top',
'checkable': True,
'callback': 'on_action_always_on_top',
},
]

View file

@ -48,6 +48,7 @@ menu_structure = [
'fit_selection',
MENU_SEPARATOR,
'fullscreen',
'always_on_top',
'show_scrollbars',
],
},

View file

@ -148,6 +148,13 @@ class BeeGraphicsView(QtWidgets.QGraphicsView, ActionsMixin):
else:
self.parent().showNormal()
def on_action_always_on_top(self, checked):
self.parent().setWindowFlag(
Qt.WindowFlags.WindowStaysOnTopHint, on=checked)
self.parent().destroy()
self.parent().create()
self.parent().show()
def on_action_show_scrollbars(self, checked):
if checked:
self.setHorizontalScrollBarPolicy(