From bcd8f94b2c6c3d2155ee015fcf3d74166cf2f256 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 31 Aug 2020 17:37:26 +0200 Subject: [PATCH] Move footer if horisontal scroll bar appears --- nw/gui/doceditor.py | 8 +++++++- nw/gui/docviewer.py | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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)