Simplify text width settings (#943)

* Remove the fixed text width switch, resolves #924
* Update tests
* Clean up code to set text width and add to viewer
This commit is contained in:
Veronica Berglyd Olsen
2021-12-31 17:17:27 +01:00
committed by GitHub
parent 6ac9e1aec4
commit 7024254960
8 changed files with 37 additions and 56 deletions
+1 -2
View File
@@ -1,5 +1,5 @@
[Main]
timestamp = 2021-09-15 14:39:52
timestamp = 2021-12-31 16:45:32
theme = default
syntax = default_light
icons = typicons_light
@@ -30,7 +30,6 @@ emphlabels = True
[Editor]
textfont = None
textsize = 12
fixedwidth = True
width = 600
margin = 40
tabwidth = 40
@@ -1,5 +1,5 @@
[Main]
timestamp = 2021-09-15 14:29:30
timestamp = 2021-12-31 16:45:34
theme = default
syntax = default_light
icons = typicons_light
@@ -30,7 +30,6 @@ emphlabels = True
[Editor]
textfont = None
textsize = 13
fixedwidth = False
width = 700
margin = 45
tabwidth = 45
+4 -4
View File
@@ -505,16 +505,16 @@ def testBaseConfig_SettersGetters(tmpConf, tmpDir, outDir, refDir):
# ============
tmpConf.guiScale = 1.0
assert tmpConf.getTextWidth() == 600
assert tmpConf.getTextWidth(False) == 600
assert tmpConf.getTextWidth(True) == 800
assert tmpConf.getTextMargin() == 40
assert tmpConf.getTabWidth() == 40
assert tmpConf.getFocusWidth() == 800
tmpConf.guiScale = 2.0
assert tmpConf.getTextWidth() == 1200
assert tmpConf.getTextWidth(False) == 1200
assert tmpConf.getTextWidth(True) == 1600
assert tmpConf.getTextMargin() == 80
assert tmpConf.getTabWidth() == 80
assert tmpConf.getFocusWidth() == 1600
# Flag Setters
# ============
@@ -144,11 +144,6 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
tabDocs.textMargin.setValue(45)
tabDocs.tabWidth.setValue(45)
qtbot.wait(keyDelay)
assert not tabDocs.textFixedW.isChecked()
qtbot.mouseClick(tabDocs.textFixedW, Qt.LeftButton)
assert tabDocs.textFixedW.isChecked()
qtbot.wait(keyDelay)
assert not tabDocs.hideFocusFooter.isChecked()
qtbot.mouseClick(tabDocs.hideFocusFooter, Qt.LeftButton)