simplify code - state_before_fullscreen seems not to be needed anymore

This commit is contained in:
Christian Helbling 2018-01-12 11:21:55 +01:00
parent 699abef159
commit 559059d244
2 changed files with 4 additions and 14 deletions

View File

@ -2197,10 +2197,6 @@ class CommandDispatcher:
window = self._tabbed_browser.window()
if window.isFullScreen():
window.setWindowState(
window.state_before_fullscreen & ~Qt.WindowFullScreen)
window.setWindowState(window.windowState() & ~Qt.WindowFullScreen)
else:
window.state_before_fullscreen = window.windowState()
window.setWindowState(Qt.WindowFullScreen | window.state_before_fullscreen)
log.misc.debug('state before fullscreen: {}'.format(
debug.qflags_key(Qt, window.state_before_fullscreen)))
window.setWindowState(window.windowState() | Qt.WindowFullScreen)

View File

@ -134,7 +134,6 @@ class MainWindow(QWidget):
Attributes:
status: The StatusBar widget.
tabbed_browser: The TabbedBrowser widget.
state_before_fullscreen: window state before activation of fullscreen.
_downloadview: The DownloadView widget.
_vbox: The main QVBoxLayout.
_commandrunner: The main CommandRunner instance.
@ -234,8 +233,6 @@ class MainWindow(QWidget):
objreg.get("app").new_window.emit(self)
self.state_before_fullscreen = self.windowState()
def _init_geometry(self, geometry):
"""Initialize the window geometry or load it from disk."""
if geometry is not None:
@ -497,12 +494,9 @@ class MainWindow(QWidget):
def _on_fullscreen_requested(self, on):
if not config.val.content.windowed_fullscreen:
if on:
self.state_before_fullscreen = self.windowState()
self.setWindowState(Qt.WindowFullScreen | self.state_before_fullscreen)
self.setWindowState(self.windowState() | Qt.WindowFullScreen)
elif self.isFullScreen():
self.setWindowState(self.state_before_fullscreen)
log.misc.debug('on: {}, state before fullscreen: {}'.format(
on, debug.qflags_key(Qt, self.state_before_fullscreen)))
self.setWindowState(self.windowState() & ~Qt.WindowFullScreen)
@cmdutils.register(instance='main-window', scope='window')
@pyqtSlot()