Fix: using font names instaed of indexes in settings.

This commit is contained in:
Filippo Scognamiglio
2014-12-16 01:22:46 +01:00
parent fa59bb06b1
commit 579194dd35
6 changed files with 46 additions and 12 deletions

View File

@@ -36,7 +36,6 @@ Tab{
currentIndex: appSettings.rasterization
onCurrentIndexChanged: {
appSettings.rasterization = currentIndex
fontChanger.updateIndex();
}
}
}
@@ -51,14 +50,22 @@ Tab{
id: fontChanger
Layout.fillWidth: true
model: appSettings.fontlist
currentIndex: updateIndex()
onActivated: {
appSettings.fontIndexes[appSettings.rasterization] = index;
var name = appSettings.fontlist.get(index).name;
appSettings.fontNames[appSettings.rasterization] = name;
appSettings.handleFontChanged();
}
function updateIndex(){
currentIndex = appSettings.fontIndexes[appSettings.rasterization];
var name = appSettings.fontNames[appSettings.rasterization];
var index = appSettings.getIndexByName(name);
if (index !== undefined)
currentIndex = index;
}
Connections{
target: appSettings
onRasterizationChanged: fontChanger.updateIndex();
}
Component.onCompleted: updateIndex();
}
Text{ text: qsTr("Scaling") }
RowLayout{