mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-18 20:20:45 +00:00
Scaling is now unified among rasterizations.
This commit is contained in:
parent
639fd53a19
commit
c94e31f82a
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user