Font scaling now works. (Yes, there are still problems with on the fly font changing)

This commit is contained in:
Filippo Scognamiglio 2013-12-28 02:42:24 +01:00
parent 0129db66ed
commit fdfd57a187
4 changed files with 23 additions and 6 deletions

View File

@ -49,8 +49,14 @@ ApplicationWindow {
onCurrentIndexChanged: shadersettings.font_index = currentIndex
}
Text{text: qsTr("Font scaling:")}
ComboBox{
SpinBox{
Layout.fillWidth: true
decimals: 1
stepSize: 0.1
minimumValue: 0.5
maximumValue: 1.5
onValueChanged: shadersettings.font_scaling = value;
Component.onCompleted: value = shadersettings.font_scaling;
}
Item{Layout.fillHeight: true}
ColorButton{

View File

@ -17,12 +17,16 @@ Item{
property int frames_index: 1
property var frames_list: framelist
property real font_scaling: 1.0
property var font: currentfont
property alias fontSize: currentfont.pixelSize
property real fontSize: currentfont.pixelSize * font_scaling
property int font_index: 2
property var fonts_list: fontlist
onFont_indexChanged: {
onFont_indexChanged: handleFontChanged();
onFont_scalingChanged: handleFontChanged();
function handleFontChanged(){
terminalwindowloader.source = "";
currentfont.source = fontlist.get(font_index).source;
currentfont.pixelSize = fontlist.get(font_index).pixelSize;
@ -85,7 +89,9 @@ Item{
scanlines = settings.scanlines ? settings.scanlines : scanlines;
frames_index = settings.frames_index ? settings.frames_index : frames_index;
font_index = settings.font_index ? settings.font_index : font_index;
font_scaling = settings.font_scaling ? settings.font_scaling: font_scaling;
}
function storeToDb(){
@ -99,7 +105,8 @@ Item{
glowing_line_strength: glowing_line_strength,
scanlines: scanlines,
frames_index: frames_index,
font_index: font_index
font_index: font_index,
font_scaling: font_scaling
}
storage.setSetting("CURRENT_SETTINGS", JSON.stringify(settings));

View File

@ -22,8 +22,7 @@ ApplicationWindow{
MenuItem {
text: qsTr("Settings")
onTriggered: {
var component = Qt.createComponent("SettingsWindow.qml");
component.createObject(terminalWindow);
settingswindow.show();
}
}
}

View File

@ -36,4 +36,9 @@ Item{
Loader{
id: terminalwindowloader
}
SettingsWindow{
id: settingswindow
visible: false
}
}