Merge pull request #434 from vkbo/issue433_move-footer-on-hscroll
Issue #433: Move footer if horisontal scroll bar appears
This commit is contained in:
+5
-5
@@ -334,10 +334,10 @@ class GuiDocEditor(QTextEdit):
|
|||||||
cM = self.mainConf.getTextMargin()
|
cM = self.mainConf.getTextMargin()
|
||||||
|
|
||||||
vBar = self.verticalScrollBar()
|
vBar = self.verticalScrollBar()
|
||||||
if vBar.isVisible():
|
sW = vBar.width() if vBar.isVisible() else 0
|
||||||
sW = vBar.width()
|
|
||||||
else:
|
hBar = self.horizontalScrollBar()
|
||||||
sW = 0
|
sH = hBar.height() if hBar.isVisible() else 0
|
||||||
|
|
||||||
if self.mainConf.textFixedW or self.theParent.isFocusMode:
|
if self.mainConf.textFixedW or self.theParent.isFocusMode:
|
||||||
if self.theParent.isFocusMode:
|
if self.theParent.isFocusMode:
|
||||||
@@ -354,7 +354,7 @@ class GuiDocEditor(QTextEdit):
|
|||||||
tW = wW - 2*tB - sW
|
tW = wW - 2*tB - sW
|
||||||
tH = self.docHeader.height()
|
tH = self.docHeader.height()
|
||||||
fH = self.docFooter.height()
|
fH = self.docFooter.height()
|
||||||
fY = self.height() - fH - tB
|
fY = self.height() - fH - tB - sH
|
||||||
self.docHeader.setGeometry(tB, tB, tW, tH)
|
self.docHeader.setGeometry(tB, tB, tW, tH)
|
||||||
self.docFooter.setGeometry(tB, fY, tW, fH)
|
self.docFooter.setGeometry(tB, fY, tW, fH)
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -250,17 +250,17 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
just ensure the margins are set correctly.
|
just ensure the margins are set correctly.
|
||||||
"""
|
"""
|
||||||
vBar = self.verticalScrollBar()
|
vBar = self.verticalScrollBar()
|
||||||
if vBar.isVisible():
|
sW = vBar.width() if vBar.isVisible() else 0
|
||||||
sW = vBar.width()
|
|
||||||
else:
|
hBar = self.horizontalScrollBar()
|
||||||
sW = 0
|
sH = hBar.height() if hBar.isVisible() else 0
|
||||||
|
|
||||||
cM = self.mainConf.getTextMargin()
|
cM = self.mainConf.getTextMargin()
|
||||||
tB = self.frameWidth()
|
tB = self.frameWidth()
|
||||||
tW = self.width() - 2*tB - sW
|
tW = self.width() - 2*tB - sW
|
||||||
tH = self.docHeader.height()
|
tH = self.docHeader.height()
|
||||||
fH = self.docFooter.height()
|
fH = self.docFooter.height()
|
||||||
fY = self.height() - fH - tB
|
fY = self.height() - fH - tB - sH
|
||||||
|
|
||||||
self.docHeader.setGeometry(tB, tB, tW, tH)
|
self.docHeader.setGeometry(tB, tB, tW, tH)
|
||||||
self.docFooter.setGeometry(tB, fY, tW, fH)
|
self.docFooter.setGeometry(tB, fY, tW, fH)
|
||||||
|
|||||||
Reference in New Issue
Block a user