From 19f75984e344a46d3ab0dffe56b6659ce53fa672 Mon Sep 17 00:00:00 2001 From: Joel Torstensson Date: Mon, 22 Dec 2014 21:57:37 +0100 Subject: [PATCH] Implemented fullscreen mode. Fix #385 --- qutebrowser/browser/commands.py | 11 +++++++++++ qutebrowser/config/configdata.py | 1 + 2 files changed, 12 insertions(+) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 0a6e280fc..f0d6ec7ae 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -243,6 +243,17 @@ class CommandDispatcher: "'previous'!") return None + @cmdutils.register(instance='command-dispatcher', name='fullscreen', + scope='window') + def full_screen(self): + """Toggle fullscreen mode.""" + main_window = objreg.get('main-window', scope='window', + window=self._win_id) + if main_window.isFullScreen(): + main_window.showNormal() + else: + main_window.showFullScreen() + @cmdutils.register(instance='command-dispatcher', scope='window') def tab_close(self, left=False, right=False, opposite=False, count: {'special': 'count'}=None): diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 8dd8de302..1416e8460 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -946,6 +946,7 @@ KEY_DATA = collections.OrderedDict([ ('forward', ['L']), ('forward -t', ['tl']), ('forward -w', ['wl']), + ('fullscreen', ['']), ('hint', ['f']), ('hint all tab', ['F']), ('hint all window', ['wf']),