diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index ca860561..8ddaa6fb 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -339,6 +339,12 @@ class GuiDocEditor(QTextEdit): else: sW = 0 + hBar = self.horizontalScrollBar() + if hBar.isVisible(): + sH = hBar.height() + else: + sH = 0 + if self.mainConf.textFixedW or self.theParent.isFocusMode: if self.theParent.isFocusMode: tW = self.mainConf.getFocusWidth() @@ -354,7 +360,7 @@ class GuiDocEditor(QTextEdit): tW = wW - 2*tB - sW tH = self.docHeader.height() fH = self.docFooter.height() - fY = self.height() - fH - tB + fY = self.height() - fH - tB - sH self.docHeader.setGeometry(tB, tB, tW, tH) self.docFooter.setGeometry(tB, fY, tW, fH) diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index f06eff22..8d373a2e 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -255,12 +255,18 @@ class GuiDocViewer(QTextBrowser): else: sW = 0 + hBar = self.horizontalScrollBar() + if hBar.isVisible(): + sH = hBar.height() + else: + sH = 0 + cM = self.mainConf.getTextMargin() tB = self.frameWidth() tW = self.width() - 2*tB - sW tH = self.docHeader.height() fH = self.docFooter.height() - fY = self.height() - fH - tB + fY = self.height() - fH - tB - sH self.docHeader.setGeometry(tB, tB, tW, tH) self.docFooter.setGeometry(tB, fY, tW, fH)