From 7b3d42918dd822eb0eb5506a7c2cb0d44753584d Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 8 Nov 2019 18:48:56 +0100 Subject: [PATCH] Move around icons and add an icons folder to assets --- install.py | 2 +- nw/assets/{graphics => icons}/novelWriter.ico | Bin nw/assets/{graphics => icons}/novelWriter.svg | 0 nw/config.py | 9 ++++++++- tests/reference/novelwriter.conf | 3 ++- 5 files changed, 11 insertions(+), 3 deletions(-) rename nw/assets/{graphics => icons}/novelWriter.ico (100%) rename nw/assets/{graphics => icons}/novelWriter.svg (100%) diff --git a/install.py b/install.py index 00d6ac00..14356f23 100755 --- a/install.py +++ b/install.py @@ -65,7 +65,7 @@ instOpt = [ "--onefile", "--add-data=%s%s%s" % (os.path.join("nw", "themes"), dotDot,"themes"), "--add-data=%s%s%s" % (os.path.join("nw", "graphics"),dotDot,"graphics"), - "--icon=%s" % os.path.join("nw", "graphics", "novelWriter.ico"), + "--icon=%s" % os.path.join("nw", "assets", "icons", "novelWriter.ico"), ] if buildWindowed: instOpt.append("--windowed") diff --git a/nw/assets/graphics/novelWriter.ico b/nw/assets/icons/novelWriter.ico similarity index 100% rename from nw/assets/graphics/novelWriter.ico rename to nw/assets/icons/novelWriter.ico diff --git a/nw/assets/graphics/novelWriter.svg b/nw/assets/icons/novelWriter.svg similarity index 100% rename from nw/assets/graphics/novelWriter.svg rename to nw/assets/icons/novelWriter.svg diff --git a/nw/config.py b/nw/config.py index 57c61d7f..340cab38 100644 --- a/nw/config.py +++ b/nw/config.py @@ -54,6 +54,7 @@ class Config: self.themeRoot = None self.graphPath = None self.dictPath = None + self.iconPath = None # Set default values self.confChanged = False @@ -61,6 +62,7 @@ class Config: ## General self.guiTheme = "default" self.guiSyntax = "default_light" + self.guiDark = False ## Sizes self.winGeometry = [1100, 650] @@ -175,7 +177,8 @@ class Config: self.themeRoot = path.join(self.assetPath,"themes") self.graphPath = path.join(self.assetPath,"graphics") self.dictPath = path.join(self.assetPath,"dict") - self.appIcon = path.join(self.graphPath, nwFiles.APP_ICON) + self.iconPath = path.join(self.assetPath,"icons") + self.appIcon = path.join(self.iconPath, nwFiles.APP_ICON) # If config folder does not exist, make it. # This assumes that the os config folder itself exists. @@ -224,6 +227,9 @@ class Config: self.guiSyntax = self._parseLine( cnfParse, cnfSec, "syntax", self.CNF_STR, self.guiSyntax ) + self.guiDark = self._parseLine( + cnfParse, cnfSec, "guidark", self.CNF_BOOL, self.guiDark + ) ## Sizes cnfSec = "Sizes" @@ -358,6 +364,7 @@ class Config: cnfParse.set(cnfSec,"timestamp", datetime.now().strftime("%Y-%m-%d %H:%M:%S")) cnfParse.set(cnfSec,"theme", str(self.guiTheme)) cnfParse.set(cnfSec,"syntax", str(self.guiSyntax)) + cnfParse.set(cnfSec,"guidark", str(self.guiDark)) ## Sizes cnfSec = "Sizes" diff --git a/tests/reference/novelwriter.conf b/tests/reference/novelwriter.conf index f6e1ea90..239301e1 100644 --- a/tests/reference/novelwriter.conf +++ b/tests/reference/novelwriter.conf @@ -1,7 +1,8 @@ [Main] -timestamp = 2019-11-08 00:27:54 +timestamp = 2019-11-08 18:43:21 theme = default syntax = default_light +guidark = False [Sizes] geometry = 1100, 650