From 0a70ec3d5d5e784549f64c457f89a9cd7d0a21ac Mon Sep 17 00:00:00 2001 From: Olivier Keshavjee Date: Sun, 28 Feb 2016 09:00:36 +0100 Subject: [PATCH] Corrects bug: fullscreen editor error when no text (wordcount = 0) --- manuskript/ui/editors/fullScreenEditor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manuskript/ui/editors/fullScreenEditor.py b/manuskript/ui/editors/fullScreenEditor.py index ac7aa711..2a64368b 100644 --- a/manuskript/ui/editors/fullScreenEditor.py +++ b/manuskript/ui/editors/fullScreenEditor.py @@ -280,9 +280,13 @@ class fullScreenEditor(QWidget): self.lblWC.setText(self.tr("{} words").format(wc)) self.locker.setWordCount(wc) + # If there's a goal, then we update the locker target's number of word accordingly + # (also if there is a word count, we deduce it. if goal and not self.locker.isLocked(): - if goal - wc > 0: + if wc and goal - wc > 0: self.locker.spnWordTarget.setValue(goal - wc) + elif not wc: + self.locker.spnWordTarget.setValue(goal) class myScrollBar(QScrollBar):