From 0d85eb34732d1caec48f63b5ebe42eaa7beda2f6 Mon Sep 17 00:00:00 2001 From: Rebecca Breu Date: Sun, 18 Apr 2021 15:41:46 +0200 Subject: [PATCH] Action for toggling fullscreen mode --- beeref/actions/actions.py | 9 ++++++++- beeref/actions/menu_structure.py | 1 + beeref/view.py | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/beeref/actions/actions.py b/beeref/actions/actions.py index 03357ab..5681776 100644 --- a/beeref/actions/actions.py +++ b/beeref/actions/actions.py @@ -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', + }, ] diff --git a/beeref/actions/menu_structure.py b/beeref/actions/menu_structure.py index 41298ca..13a48a5 100644 --- a/beeref/actions/menu_structure.py +++ b/beeref/actions/menu_structure.py @@ -47,6 +47,7 @@ menu_structure = [ 'fit_scene', 'fit_selection', MENU_SEPARATOR, + 'fullscreen', 'show_scrollbars', ], }, diff --git a/beeref/view.py b/beeref/view.py index f45a5e5..b983980 100644 --- a/beeref/view.py +++ b/beeref/view.py @@ -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(