added option to limit fullscreen to window only

This commit is contained in:
Dasith Gunawardhana 2017-11-13 21:38:02 -05:00
parent 408ceefad1
commit 36c8ca9790
3 changed files with 12 additions and 2 deletions

View File

@ -259,6 +259,12 @@ content.default_encoding:
The encoding must be a string describing an encoding such as _utf-8_,
_iso-8859-1_, etc.
content.desktop_fullscreen:
type: Bool
default: true
desc: >-
Allow fullscreen to cover the entire desktop.
content.developer_extras:
type: Bool
default: false

View File

@ -493,7 +493,8 @@ class MainWindow(QWidget):
def _on_fullscreen_requested(self, on):
if on:
self.state_before_fullscreen = self.windowState()
self.showFullScreen()
if config.val.content.desktop_fullscreen:
self.showFullScreen()
elif self.isFullScreen():
self.setWindowState(self.state_before_fullscreen)
log.misc.debug('on: {}, state before fullscreen: {}'.format(

View File

@ -300,7 +300,10 @@ class FullscreenNotification(QLabel):
self.setText("Page is now fullscreen.")
self.resize(self.sizeHint())
geom = QApplication.desktop().screenGeometry(self)
if config.val.content.desktop_fullscreen:
geom = QApplication.desktop().screenGeometry(self)
else:
geom = self.parentWidget().geometry()
self.move((geom.width() - self.sizeHint().width()) / 2, 30)
def set_timeout(self, timeout):