Settings window seems to work nicely.
This commit is contained in:
@@ -10,28 +10,38 @@ Tab{
|
||||
Layout.fillWidth: true
|
||||
ComboBox {
|
||||
id: rasterizationBox
|
||||
property string selectedElement: model[currentIndex]
|
||||
anchors.fill: parent
|
||||
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
|
||||
currentIndex: shadersettings.rasterization
|
||||
onCurrentIndexChanged: shadersettings.rasterization = currentIndex
|
||||
onCurrentIndexChanged: {
|
||||
scalingChanger.enabled = false;
|
||||
shadersettings.rasterization = currentIndex
|
||||
fontChanger.updateIndex();
|
||||
scalingChanger.updateIndex();
|
||||
scalingChanger.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
GroupBox{
|
||||
title: qsTr("Font")
|
||||
title: qsTr("Font") + " (" + rasterizationBox.selectedElement + ")"
|
||||
Layout.fillWidth: true
|
||||
GridLayout{
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
Text{ text: qsTr("Name") }
|
||||
ComboBox{
|
||||
id: fontChanged
|
||||
id: fontChanger
|
||||
Layout.fillWidth: true
|
||||
model: shadersettings.fontlist
|
||||
currentIndex: shadersettings.fontIndexes[shadersettings.rasterization]
|
||||
onCurrentIndexChanged: {
|
||||
shadersettings.fontIndexes[shadersettings.rasterization] = currentIndex;
|
||||
currentIndex: updateIndex()
|
||||
onActivated: {
|
||||
shadersettings.fontIndexes[shadersettings.rasterization] = index;
|
||||
shadersettings.handleFontChanged();
|
||||
}
|
||||
function updateIndex(){
|
||||
currentIndex = shadersettings.fontIndexes[shadersettings.rasterization];
|
||||
}
|
||||
}
|
||||
Text{ text: qsTr("Scaling") }
|
||||
RowLayout{
|
||||
@@ -42,12 +52,16 @@ Tab{
|
||||
minimumValue: 0
|
||||
maximumValue: shadersettings.fontScalingList.length - 1
|
||||
stepSize: 1
|
||||
value: shadersettings.fontScalingIndexes[shadersettings.rasterization]
|
||||
tickmarksEnabled: true
|
||||
value: updateIndex()
|
||||
onValueChanged: {
|
||||
if(!enabled) return; //Ugly and hacky solution. Look for a better solution.
|
||||
shadersettings.fontScalingIndexes[shadersettings.rasterization] = value;
|
||||
console.log(shadersettings.fontScalingIndexes);
|
||||
shadersettings.handleFontChanged();
|
||||
}
|
||||
function updateIndex(){
|
||||
value = shadersettings.fontScalingIndexes[shadersettings.rasterization];
|
||||
}
|
||||
}
|
||||
Text{
|
||||
text: shadersettings.fontScalingList[scalingChanger.value].toFixed(2)
|
||||
|
||||
Reference in New Issue
Block a user