mirror of
https://github.com/rbreu/beeref.git
synced 2026-03-11 08:54:28 +00:00
Action for toggling always on top mode
This commit is contained in:
parent
0d85eb3473
commit
ff073445af
3 changed files with 14 additions and 0 deletions
|
|
@ -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',
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ menu_structure = [
|
|||
'fit_selection',
|
||||
MENU_SEPARATOR,
|
||||
'fullscreen',
|
||||
'always_on_top',
|
||||
'show_scrollbars',
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue