From c94e31f82a7861d5a3103c9e3bf07a1da72e47de Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Wed, 10 Sep 2014 01:14:10 +0200 Subject: [PATCH] Scaling is now unified among rasterizations. --- app/qml/ApplicationSettings.qml | 14 +++++++------- app/qml/FontPixels.qml | 6 ++---- app/qml/FontScanlines.qml | 6 ++---- app/qml/Fonts.qml | 6 ++---- app/qml/main.qml | 4 ++-- 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 308f9be..350bc41 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -117,17 +117,17 @@ Item{ } signal fontScalingChanged - property var fontScalingList: fontManager.item.fontScalingList - property var fontScalingIndexes: [5,1,1] + property var fontScalingList: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5] + property int fontScalingIndex: 5 function setScalingIndex(newScaling){ - fontScalingIndexes[rasterization] = newScaling; + fontScalingIndex = newScaling; fontScalingChanged(); handleFontChanged(); } function getScalingIndex(){ - return fontScalingIndexes[rasterization]; + return fontScalingIndex; } property var fontIndexes: [0,0,0] @@ -136,7 +136,7 @@ Item{ function handleFontChanged(){ if(!fontManager.item) return; fontManager.item.selectedFontIndex = fontIndexes[rasterization]; - fontManager.item.selectedScalingIndex = fontScalingIndexes[rasterization]; + fontManager.item.scaling = fontScalingList[fontScalingIndex]; var fontSource = fontManager.item.source; var pixelSize = fontManager.item.pixelSize; @@ -164,7 +164,7 @@ Item{ fps: fps, window_scaling: window_scaling, show_terminal_size: show_terminal_size, - fontScalingIndexes: fontScalingIndexes, + fontScalingIndex: fontScalingIndex, fontIndexes: fontIndexes, frameReflections: _frameReflections, showMenubar: showMenubar @@ -231,7 +231,7 @@ Item{ window_scaling = settings.window_scaling !== undefined ? settings.window_scaling : window_scaling fontIndexes = settings.fontIndexes !== undefined ? settings.fontIndexes : fontIndexes - fontScalingIndexes = settings.fontScalingIndexes !== undefined ? settings.fontScalingIndexes : fontScalingIndexes + fontScalingIndex = settings.fontScalingIndex !== undefined ? settings.fontScalingIndex : fontScalingIndex _frameReflections = settings.frameReflections !== undefined ? settings.frameReflections : _frameReflections; diff --git a/app/qml/FontPixels.qml b/app/qml/FontPixels.qml index c430bef..4c0afbd 100644 --- a/app/qml/FontPixels.qml +++ b/app/qml/FontPixels.qml @@ -22,15 +22,13 @@ import QtQuick 2.2 Item{ property int selectedFontIndex - property int selectedScalingIndex + property real scaling property alias fontlist: fontlist property var _font: fontlist.get(selectedFontIndex) - property var _scaling: fontScalingList[selectedScalingIndex] property var source: _font.source - property var fontScalingList: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5] property int pixelSize: _font.pixelSize property int lineSpacing: _font.lineSpacing - property real screenScaling: _scaling * _font.baseScaling + property real screenScaling: scaling * _font.baseScaling ListModel{ id: fontlist diff --git a/app/qml/FontScanlines.qml b/app/qml/FontScanlines.qml index c430bef..4c0afbd 100644 --- a/app/qml/FontScanlines.qml +++ b/app/qml/FontScanlines.qml @@ -22,15 +22,13 @@ import QtQuick 2.2 Item{ property int selectedFontIndex - property int selectedScalingIndex + property real scaling property alias fontlist: fontlist property var _font: fontlist.get(selectedFontIndex) - property var _scaling: fontScalingList[selectedScalingIndex] property var source: _font.source - property var fontScalingList: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5] property int pixelSize: _font.pixelSize property int lineSpacing: _font.lineSpacing - property real screenScaling: _scaling * _font.baseScaling + property real screenScaling: scaling * _font.baseScaling ListModel{ id: fontlist diff --git a/app/qml/Fonts.qml b/app/qml/Fonts.qml index d6df7ea..621251a 100644 --- a/app/qml/Fonts.qml +++ b/app/qml/Fonts.qml @@ -22,13 +22,11 @@ import QtQuick 2.2 Item{ property int selectedFontIndex - property int selectedScalingIndex + property real scaling property alias fontlist: fontlist property var source: fontlist.get(selectedFontIndex).source property var _font: fontlist.get(selectedFontIndex) - property var _scaling: fontScalingList[selectedScalingIndex] - property var fontScalingList: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5] - property int pixelSize: _font.pixelSize * _scaling + property int pixelSize: _font.pixelSize * scaling property int lineSpacing: pixelSize * _font.lineSpacing property real screenScaling: 1.0 diff --git a/app/qml/main.qml b/app/qml/main.qml index 7b5ca04..47f42f2 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -83,7 +83,7 @@ ApplicationWindow{ text: qsTr("Zoom In") shortcut: "Ctrl++" onTriggered: { - var oldScaling = shadersettings.fontScalingIndexes[shadersettings.rasterization]; + var oldScaling = shadersettings.fontScalingIndex; var maxScalingIndex = shadersettings.fontScalingList.length - 1; shadersettings.setScalingIndex(Math.min(oldScaling + 1, maxScalingIndex)); } @@ -93,7 +93,7 @@ ApplicationWindow{ text: qsTr("Zoom Out") shortcut: "Ctrl+-" onTriggered: { - var oldScaling = shadersettings.fontScalingIndexes[shadersettings.rasterization]; + var oldScaling = shadersettings.fontScalingIndex; shadersettings.setScalingIndex(Math.max(oldScaling - 1, 0)); } }