Fixed the size of the doc title bar when the scroll bar is present

This commit is contained in:
Veronica K. B. Olsen
2020-06-08 17:40:34 +02:00
parent 3dc59d393c
commit f24ec180b2
2 changed files with 15 additions and 7 deletions
+8 -6
View File
@@ -314,12 +314,14 @@ class GuiDocEditor(QTextEdit):
just ensure the margins are set correctly. just ensure the margins are set correctly.
""" """
cM = self.mainConf.getTextMargin() cM = self.mainConf.getTextMargin()
vBar = self.verticalScrollBar()
if vBar.isVisible():
sW = vBar.width()
else:
sW = 0
if self.mainConf.textFixedW or self.theParent.isZenMode: if self.mainConf.textFixedW or self.theParent.isZenMode:
vBar = self.verticalScrollBar()
if vBar.isVisible():
sW = vBar.width()
else:
sW = 0
if self.theParent.isZenMode: if self.theParent.isZenMode:
tW = self.mainConf.getZenWidth() tW = self.mainConf.getZenWidth()
else: else:
@@ -332,7 +334,7 @@ class GuiDocEditor(QTextEdit):
tM = cM tM = cM
tB = self.lineWidth() tB = self.lineWidth()
tW = self.width() - 2*tB tW = self.width() - 2*tB - sW
tH = self.docTitle.height() tH = self.docTitle.height()
tT = cM - tH tT = cM - tH
self.docTitle.setGeometry(tB, tB, tW, tH) self.docTitle.setGeometry(tB, tB, tW, tH)
+7 -1
View File
@@ -224,8 +224,14 @@ class GuiDocViewer(QTextBrowser):
Config.textFixedW is enabled or we're in Zen mode. Otherwise, Config.textFixedW is enabled or we're in Zen mode. Otherwise,
just ensure the margins are set correctly. just ensure the margins are set correctly.
""" """
vBar = self.verticalScrollBar()
if vBar.isVisible():
sW = vBar.width()
else:
sW = 0
tB = self.lineWidth() tB = self.lineWidth()
tW = self.width() - 2*tB tW = self.width() - 2*tB - sW
tH = self.docTitle.height() tH = self.docTitle.height()
tT = self.mainConf.getTextMargin() - tH tT = self.mainConf.getTextMargin() - tH
self.docTitle.setGeometry(tB, tB, tW, tH) self.docTitle.setGeometry(tB, tB, tW, tH)