From aefb4e782cbe18bba898e5cbac095b03b6a30c3f Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 31 Aug 2020 17:41:06 +0200 Subject: [PATCH] Use more compact notation --- nw/gui/doceditor.py | 10 ++-------- nw/gui/docviewer.py | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 8ddaa6fb..b0e4b5f4 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -334,16 +334,10 @@ class GuiDocEditor(QTextEdit): cM = self.mainConf.getTextMargin() vBar = self.verticalScrollBar() - if vBar.isVisible(): - sW = vBar.width() - else: - sW = 0 + sW = vBar.width() if vBar.isVisible() else 0 hBar = self.horizontalScrollBar() - if hBar.isVisible(): - sH = hBar.height() - else: - sH = 0 + sH = hBar.height() if hBar.isVisible() else 0 if self.mainConf.textFixedW or self.theParent.isFocusMode: if self.theParent.isFocusMode: diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index 8d373a2e..c3378806 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -250,16 +250,10 @@ class GuiDocViewer(QTextBrowser): just ensure the margins are set correctly. """ vBar = self.verticalScrollBar() - if vBar.isVisible(): - sW = vBar.width() - else: - sW = 0 + sW = vBar.width() if vBar.isVisible() else 0 hBar = self.horizontalScrollBar() - if hBar.isVisible(): - sH = hBar.height() - else: - sH = 0 + sH = hBar.height() if hBar.isVisible() else 0 cM = self.mainConf.getTextMargin() tB = self.frameWidth()