From 9dd1a606291a16f93d6d20a5daa5e2c2f33150ce Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 1 Nov 2022 19:11:38 +0100 Subject: [PATCH 1/2] Fix bug with active icon on item details panel --- novelwriter/gui/itemdetails.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/novelwriter/gui/itemdetails.py b/novelwriter/gui/itemdetails.py index e8eae31d..9183ebfe 100644 --- a/novelwriter/gui/itemdetails.py +++ b/novelwriter/gui/itemdetails.py @@ -220,9 +220,6 @@ class GuiItemDetails(QWidget): def updateTheme(self): """Update theme elements. """ - iPx = self.mainTheme.baseIconSize - self._expCheck = self.mainTheme.getPixmap("check", (iPx, iPx)) - self._expCross = self.mainTheme.getPixmap("cross", (iPx, iPx)) self.updateViewBox(self._itemHandle) return @@ -255,11 +252,11 @@ class GuiItemDetails(QWidget): if nwItem.isFileType(): if nwItem.isActive: - self.labelIcon.setPixmap(self._expCheck) + self.labelIcon.setPixmap(self.mainTheme.getPixmap("checked", (iPx, iPx))) else: - self.labelIcon.setPixmap(self._expCross) + self.labelIcon.setPixmap(self.mainTheme.getPixmap("unchecked", (iPx, iPx))) else: - self.labelIcon.setPixmap(QPixmap(1, 1)) + self.labelIcon.setPixmap(self.mainTheme.getPixmap("noncheckable", (iPx, iPx))) self.labelData.setText(theLabel) From a2f92c12232dc4f5662fe983e10ac738c4410535 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 1 Nov 2022 19:15:32 +0100 Subject: [PATCH 2/2] Auto-open first document on new project (#1219) --- novelwriter/guimain.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index f984d5d2..ae9529e6 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -534,7 +534,14 @@ class GuiMain(QMainWindow): self._updateStatusWordCount() # Restore previously open documents, if any + # If none was recorded, open the first document found lastEdited = self.theProject.data.getLastHandle("editor") + if lastEdited is None: + for nwItem in self.theProject.tree: + if nwItem and nwItem.isFileType(): + lastEdited = nwItem.itemHandle + break + if lastEdited is not None: self.openDocument(lastEdited, doScroll=True)