Remove fullscreen setting in config file

This commit is contained in:
Veronica Berglyd Olsen
2023-08-06 14:49:35 +02:00
parent 352b70d060
commit 6f1aa5b812
5 changed files with 16 additions and 37 deletions
+3 -6
View File
@@ -175,10 +175,9 @@ class Config:
self.spellLanguage = "en"
# State
self.isFullScreen = False # Last fullscreen state
self.showRefPanel = True # The reference panel for the viewer is visible
self.viewComments = True # Comments are shown in the viewer
self.viewSynopsis = True # Synopsis is shown in the viewer
self.showRefPanel = True # The reference panel for the viewer is visible
self.viewComments = True # Comments are shown in the viewer
self.viewSynopsis = True # Synopsis is shown in the viewer
# Search Bar Switches
self.searchCase = False
@@ -603,7 +602,6 @@ class Config:
# State
cnfSec = "State"
self.isFullScreen = theConf.rdBool(cnfSec, "fullscreen", self.isFullScreen)
self.showRefPanel = theConf.rdBool(cnfSec, "showrefpanel", self.showRefPanel)
self.viewComments = theConf.rdBool(cnfSec, "viewcomments", self.viewComments)
self.viewSynopsis = theConf.rdBool(cnfSec, "viewsynopsis", self.viewSynopsis)
@@ -732,7 +730,6 @@ class Config:
}
theConf["State"] = {
"fullscreen": str(self.isFullScreen),
"showrefpanel": str(self.showRefPanel),
"viewcomments": str(self.viewComments),
"viewsynopsis": str(self.viewSynopsis),
+6 -22
View File
@@ -313,8 +313,6 @@ class GuiMain(QMainWindow):
# Handle Windows Mode
self.showNormal()
if CONFIG.isFullScreen:
self.toggleFullScreenMode()
logger.debug("Ready: GUI")
@@ -1188,9 +1186,8 @@ class GuiMain(QMainWindow):
# Main Window Actions
##
def closeMain(self):
"""Save everything, and close novelWriter.
"""
def closeMain(self) -> bool:
"""Save everything, and close novelWriter."""
if self.hasProject:
msgYes = self.askQuestion(
self.tr("Exit"),
@@ -1211,7 +1208,8 @@ class GuiMain(QMainWindow):
CONFIG.setViewPanePos(self.splitView.sizes())
CONFIG.showRefPanel = self.viewMeta.isVisible()
if not CONFIG.isFullScreen:
if self.windowState() & Qt.WindowFullScreen != Qt.WindowFullScreen:
# Ignore window size if in full screen mode
CONFIG.setMainWinSize(self.width(), self.height())
if self.hasProject:
@@ -1297,23 +1295,9 @@ class GuiMain(QMainWindow):
return True
def toggleFullScreenMode(self):
"""Main GUI full screen mode. The mode is tracked by the flag
in config. This only tracks whether the window has been
maximised using the internal commands, and may not be correct
if the user uses the system window manager. Currently, Qt
doesn't have access to the exact state of the window.
"""
def toggleFullScreenMode(self) -> None:
"""Toggle full screen mode"""
self.setWindowState(self.windowState() ^ Qt.WindowFullScreen)
winState = self.windowState() & Qt.WindowFullScreen == Qt.WindowFullScreen
if winState:
logger.debug("Activated full screen mode")
else:
logger.debug("Deactivated full screen mode")
CONFIG.isFullScreen = winState
return
##