Bugfixes
This commit is contained in:
parent
616090da3d
commit
979fea1cee
|
@ -190,7 +190,10 @@ QtObject:
|
|||
notify = newVersionChanged
|
||||
|
||||
proc readTextFile*(self: UtilsView, filepath: string): string {.slot.} =
|
||||
return readFile(filepath)
|
||||
try:
|
||||
return readFile(filepath)
|
||||
except:
|
||||
return ""
|
||||
|
||||
proc writeTextFile*(self: UtilsView, filepath: string, text: string): bool {.slot.} =
|
||||
try:
|
||||
|
|
|
@ -189,7 +189,13 @@ ScrollView {
|
|||
minimumValue: 50
|
||||
maximumValue: 200
|
||||
stepSize: 50
|
||||
value: parseFloat(utilsModel.readTextFile(uiScaleFilePath)) * 100
|
||||
value: {
|
||||
let scaleFactorStr = utilsModel.readTextFile(uiScaleFilePath)
|
||||
if (scaleFactorStr === "") {
|
||||
return 100
|
||||
}
|
||||
return parseFloat(scaleFactorStr) * 100
|
||||
}
|
||||
onValueChanged: {
|
||||
utilsModel.writeTextFile(uiScaleFilePath, value / 100.0)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue