Action for toggling fullscreen mode

This commit is contained in:
Rebecca Breu 2021-04-18 15:41:46 +02:00
parent 87609944a5
commit 0d85eb3473
3 changed files with 15 additions and 1 deletions

View file

@ -178,7 +178,7 @@ actions = [
{
'id': 'help',
'text': '&Help',
'shortcuts': ['Ctrl+H'],
'shortcuts': ['F1', 'Ctrl+H'],
'callback': 'on_action_help',
},
{
@ -187,4 +187,11 @@ actions = [
'checkable': True,
'callback': 'on_action_show_scrollbars',
},
{
'id': 'fullscreen',
'text': '&Fullscreen',
'shortcuts': ['F11'],
'checkable': True,
'callback': 'on_action_fullscreen',
},
]

View file

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

View file

@ -142,6 +142,12 @@ class BeeGraphicsView(QtWidgets.QGraphicsView, ActionsMixin):
def on_action_fit_selection(self):
self.fit_rect(self.scene.itemsBoundingRect(selection_only=True))
def on_action_fullscreen(self, checked):
if checked:
self.parent().showFullScreen()
else:
self.parent().showNormal()
def on_action_show_scrollbars(self, checked):
if checked:
self.setHorizontalScrollBarPolicy(