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" self.spellLanguage = "en"
# State # State
self.isFullScreen = False # Last fullscreen state self.showRefPanel = True # The reference panel for the viewer is visible
self.showRefPanel = True # The reference panel for the viewer is visible self.viewComments = True # Comments are shown in the viewer
self.viewComments = True # Comments are shown in the viewer self.viewSynopsis = True # Synopsis is shown in the viewer
self.viewSynopsis = True # Synopsis is shown in the viewer
# Search Bar Switches # Search Bar Switches
self.searchCase = False self.searchCase = False
@@ -603,7 +602,6 @@ class Config:
# State # State
cnfSec = "State" cnfSec = "State"
self.isFullScreen = theConf.rdBool(cnfSec, "fullscreen", self.isFullScreen)
self.showRefPanel = theConf.rdBool(cnfSec, "showrefpanel", self.showRefPanel) self.showRefPanel = theConf.rdBool(cnfSec, "showrefpanel", self.showRefPanel)
self.viewComments = theConf.rdBool(cnfSec, "viewcomments", self.viewComments) self.viewComments = theConf.rdBool(cnfSec, "viewcomments", self.viewComments)
self.viewSynopsis = theConf.rdBool(cnfSec, "viewsynopsis", self.viewSynopsis) self.viewSynopsis = theConf.rdBool(cnfSec, "viewsynopsis", self.viewSynopsis)
@@ -732,7 +730,6 @@ class Config:
} }
theConf["State"] = { theConf["State"] = {
"fullscreen": str(self.isFullScreen),
"showrefpanel": str(self.showRefPanel), "showrefpanel": str(self.showRefPanel),
"viewcomments": str(self.viewComments), "viewcomments": str(self.viewComments),
"viewsynopsis": str(self.viewSynopsis), "viewsynopsis": str(self.viewSynopsis),
+6 -22
View File
@@ -313,8 +313,6 @@ class GuiMain(QMainWindow):
# Handle Windows Mode # Handle Windows Mode
self.showNormal() self.showNormal()
if CONFIG.isFullScreen:
self.toggleFullScreenMode()
logger.debug("Ready: GUI") logger.debug("Ready: GUI")
@@ -1188,9 +1186,8 @@ class GuiMain(QMainWindow):
# Main Window Actions # Main Window Actions
## ##
def closeMain(self): def closeMain(self) -> bool:
"""Save everything, and close novelWriter. """Save everything, and close novelWriter."""
"""
if self.hasProject: if self.hasProject:
msgYes = self.askQuestion( msgYes = self.askQuestion(
self.tr("Exit"), self.tr("Exit"),
@@ -1211,7 +1208,8 @@ class GuiMain(QMainWindow):
CONFIG.setViewPanePos(self.splitView.sizes()) CONFIG.setViewPanePos(self.splitView.sizes())
CONFIG.showRefPanel = self.viewMeta.isVisible() 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()) CONFIG.setMainWinSize(self.width(), self.height())
if self.hasProject: if self.hasProject:
@@ -1297,23 +1295,9 @@ class GuiMain(QMainWindow):
return True return True
def toggleFullScreenMode(self): def toggleFullScreenMode(self) -> None:
"""Main GUI full screen mode. The mode is tracked by the flag """Toggle full screen mode"""
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.
"""
self.setWindowState(self.windowState() ^ Qt.WindowFullScreen) 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 return
## ##
+1 -2
View File
@@ -1,5 +1,5 @@
[Meta] [Meta]
timestamp = 2023-05-31 10:52:21 timestamp = 2023-08-02 14:53:36
[Main] [Main]
theme = default theme = default
@@ -69,7 +69,6 @@ stopwhenidle = True
useridletime = 300 useridletime = 300
[State] [State]
fullscreen = False
showrefpanel = True showrefpanel = True
viewcomments = True viewcomments = True
viewsynopsis = True viewsynopsis = True
@@ -1,5 +1,5 @@
[Meta] [Meta]
timestamp = 2022-11-11 12:48:20 timestamp = 2023-08-02 14:53:40
[Main] [Main]
theme = default theme = default
@@ -10,11 +10,11 @@ localisation = en_GB
hidevscroll = True hidevscroll = True
hidehscroll = True hidehscroll = True
lastnotes = 0x0 lastnotes = 0x0
lastpath = /home/vkbo/Code/novelWriter/Source/tests/temp/function lastpath =
[Sizes] [Sizes]
mainwindow = 1200, 650 mainwindow = 1200, 650
preferences = 699, 614 preferences = 765, 614
projloadcols = 280, 60, 160 projloadcols = 280, 60, 160
mainpane = 300, 800 mainpane = 300, 800
viewpane = 500, 150 viewpane = 500, 150
@@ -69,7 +69,6 @@ stopwhenidle = True
useridletime = 300 useridletime = 300
[State] [State]
fullscreen = False
showrefpanel = True showrefpanel = True
viewcomments = True viewcomments = True
viewsynopsis = True viewsynopsis = True
+3 -3
View File
@@ -590,11 +590,11 @@ def testGuiMain_FocusFullMode(qtbot, nwGUI, projPath, mockRnd):
# Full Screen Mode # Full Screen Mode
# ================ # ================
assert CONFIG.isFullScreen is False assert nwGUI.windowState() & Qt.WindowFullScreen != Qt.WindowFullScreen
nwGUI.toggleFullScreenMode() nwGUI.toggleFullScreenMode()
assert CONFIG.isFullScreen is True assert nwGUI.windowState() & Qt.WindowFullScreen == Qt.WindowFullScreen
nwGUI.toggleFullScreenMode() nwGUI.toggleFullScreenMode()
assert CONFIG.isFullScreen is False assert nwGUI.windowState() & Qt.WindowFullScreen != Qt.WindowFullScreen
# qtbot.stop() # qtbot.stop()