simplify code - state_before_fullscreen seems not to be needed anymore
This commit is contained in:
parent
699abef159
commit
559059d244
@ -2197,10 +2197,6 @@ class CommandDispatcher:
|
|||||||
|
|
||||||
window = self._tabbed_browser.window()
|
window = self._tabbed_browser.window()
|
||||||
if window.isFullScreen():
|
if window.isFullScreen():
|
||||||
window.setWindowState(
|
window.setWindowState(window.windowState() & ~Qt.WindowFullScreen)
|
||||||
window.state_before_fullscreen & ~Qt.WindowFullScreen)
|
|
||||||
else:
|
else:
|
||||||
window.state_before_fullscreen = window.windowState()
|
window.setWindowState(window.windowState() | Qt.WindowFullScreen)
|
||||||
window.setWindowState(Qt.WindowFullScreen | window.state_before_fullscreen)
|
|
||||||
log.misc.debug('state before fullscreen: {}'.format(
|
|
||||||
debug.qflags_key(Qt, window.state_before_fullscreen)))
|
|
||||||
|
@ -134,7 +134,6 @@ class MainWindow(QWidget):
|
|||||||
Attributes:
|
Attributes:
|
||||||
status: The StatusBar widget.
|
status: The StatusBar widget.
|
||||||
tabbed_browser: The TabbedBrowser widget.
|
tabbed_browser: The TabbedBrowser widget.
|
||||||
state_before_fullscreen: window state before activation of fullscreen.
|
|
||||||
_downloadview: The DownloadView widget.
|
_downloadview: The DownloadView widget.
|
||||||
_vbox: The main QVBoxLayout.
|
_vbox: The main QVBoxLayout.
|
||||||
_commandrunner: The main CommandRunner instance.
|
_commandrunner: The main CommandRunner instance.
|
||||||
@ -234,8 +233,6 @@ class MainWindow(QWidget):
|
|||||||
|
|
||||||
objreg.get("app").new_window.emit(self)
|
objreg.get("app").new_window.emit(self)
|
||||||
|
|
||||||
self.state_before_fullscreen = self.windowState()
|
|
||||||
|
|
||||||
def _init_geometry(self, geometry):
|
def _init_geometry(self, geometry):
|
||||||
"""Initialize the window geometry or load it from disk."""
|
"""Initialize the window geometry or load it from disk."""
|
||||||
if geometry is not None:
|
if geometry is not None:
|
||||||
@ -497,12 +494,9 @@ class MainWindow(QWidget):
|
|||||||
def _on_fullscreen_requested(self, on):
|
def _on_fullscreen_requested(self, on):
|
||||||
if not config.val.content.windowed_fullscreen:
|
if not config.val.content.windowed_fullscreen:
|
||||||
if on:
|
if on:
|
||||||
self.state_before_fullscreen = self.windowState()
|
self.setWindowState(self.windowState() | Qt.WindowFullScreen)
|
||||||
self.setWindowState(Qt.WindowFullScreen | self.state_before_fullscreen)
|
|
||||||
elif self.isFullScreen():
|
elif self.isFullScreen():
|
||||||
self.setWindowState(self.state_before_fullscreen)
|
self.setWindowState(self.windowState() & ~Qt.WindowFullScreen)
|
||||||
log.misc.debug('on: {}, state before fullscreen: {}'.format(
|
|
||||||
on, debug.qflags_key(Qt, self.state_before_fullscreen)))
|
|
||||||
|
|
||||||
@cmdutils.register(instance='main-window', scope='window')
|
@cmdutils.register(instance='main-window', scope='window')
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
Loading…
Reference in New Issue
Block a user