mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-07 13:41:27 +00:00
Scaling is now unified among rasterizations.
This commit is contained in:
parent
639fd53a19
commit
c94e31f82a
@ -117,17 +117,17 @@ Item{
|
|||||||
}
|
}
|
||||||
|
|
||||||
signal fontScalingChanged
|
signal fontScalingChanged
|
||||||
property var fontScalingList: fontManager.item.fontScalingList
|
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 var fontScalingIndexes: [5,1,1]
|
property int fontScalingIndex: 5
|
||||||
|
|
||||||
function setScalingIndex(newScaling){
|
function setScalingIndex(newScaling){
|
||||||
fontScalingIndexes[rasterization] = newScaling;
|
fontScalingIndex = newScaling;
|
||||||
fontScalingChanged();
|
fontScalingChanged();
|
||||||
handleFontChanged();
|
handleFontChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getScalingIndex(){
|
function getScalingIndex(){
|
||||||
return fontScalingIndexes[rasterization];
|
return fontScalingIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
property var fontIndexes: [0,0,0]
|
property var fontIndexes: [0,0,0]
|
||||||
@ -136,7 +136,7 @@ Item{
|
|||||||
function handleFontChanged(){
|
function handleFontChanged(){
|
||||||
if(!fontManager.item) return;
|
if(!fontManager.item) return;
|
||||||
fontManager.item.selectedFontIndex = fontIndexes[rasterization];
|
fontManager.item.selectedFontIndex = fontIndexes[rasterization];
|
||||||
fontManager.item.selectedScalingIndex = fontScalingIndexes[rasterization];
|
fontManager.item.scaling = fontScalingList[fontScalingIndex];
|
||||||
|
|
||||||
var fontSource = fontManager.item.source;
|
var fontSource = fontManager.item.source;
|
||||||
var pixelSize = fontManager.item.pixelSize;
|
var pixelSize = fontManager.item.pixelSize;
|
||||||
@ -164,7 +164,7 @@ Item{
|
|||||||
fps: fps,
|
fps: fps,
|
||||||
window_scaling: window_scaling,
|
window_scaling: window_scaling,
|
||||||
show_terminal_size: show_terminal_size,
|
show_terminal_size: show_terminal_size,
|
||||||
fontScalingIndexes: fontScalingIndexes,
|
fontScalingIndex: fontScalingIndex,
|
||||||
fontIndexes: fontIndexes,
|
fontIndexes: fontIndexes,
|
||||||
frameReflections: _frameReflections,
|
frameReflections: _frameReflections,
|
||||||
showMenubar: showMenubar
|
showMenubar: showMenubar
|
||||||
@ -231,7 +231,7 @@ Item{
|
|||||||
window_scaling = settings.window_scaling !== undefined ? settings.window_scaling : window_scaling
|
window_scaling = settings.window_scaling !== undefined ? settings.window_scaling : window_scaling
|
||||||
|
|
||||||
fontIndexes = settings.fontIndexes !== undefined ? settings.fontIndexes : fontIndexes
|
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;
|
_frameReflections = settings.frameReflections !== undefined ? settings.frameReflections : _frameReflections;
|
||||||
|
|
||||||
|
@ -22,15 +22,13 @@ import QtQuick 2.2
|
|||||||
|
|
||||||
Item{
|
Item{
|
||||||
property int selectedFontIndex
|
property int selectedFontIndex
|
||||||
property int selectedScalingIndex
|
property real scaling
|
||||||
property alias fontlist: fontlist
|
property alias fontlist: fontlist
|
||||||
property var _font: fontlist.get(selectedFontIndex)
|
property var _font: fontlist.get(selectedFontIndex)
|
||||||
property var _scaling: fontScalingList[selectedScalingIndex]
|
|
||||||
property var source: _font.source
|
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 pixelSize: _font.pixelSize
|
||||||
property int lineSpacing: _font.lineSpacing
|
property int lineSpacing: _font.lineSpacing
|
||||||
property real screenScaling: _scaling * _font.baseScaling
|
property real screenScaling: scaling * _font.baseScaling
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: fontlist
|
id: fontlist
|
||||||
|
@ -22,15 +22,13 @@ import QtQuick 2.2
|
|||||||
|
|
||||||
Item{
|
Item{
|
||||||
property int selectedFontIndex
|
property int selectedFontIndex
|
||||||
property int selectedScalingIndex
|
property real scaling
|
||||||
property alias fontlist: fontlist
|
property alias fontlist: fontlist
|
||||||
property var _font: fontlist.get(selectedFontIndex)
|
property var _font: fontlist.get(selectedFontIndex)
|
||||||
property var _scaling: fontScalingList[selectedScalingIndex]
|
|
||||||
property var source: _font.source
|
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 pixelSize: _font.pixelSize
|
||||||
property int lineSpacing: _font.lineSpacing
|
property int lineSpacing: _font.lineSpacing
|
||||||
property real screenScaling: _scaling * _font.baseScaling
|
property real screenScaling: scaling * _font.baseScaling
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: fontlist
|
id: fontlist
|
||||||
|
@ -22,13 +22,11 @@ import QtQuick 2.2
|
|||||||
|
|
||||||
Item{
|
Item{
|
||||||
property int selectedFontIndex
|
property int selectedFontIndex
|
||||||
property int selectedScalingIndex
|
property real scaling
|
||||||
property alias fontlist: fontlist
|
property alias fontlist: fontlist
|
||||||
property var source: fontlist.get(selectedFontIndex).source
|
property var source: fontlist.get(selectedFontIndex).source
|
||||||
property var _font: fontlist.get(selectedFontIndex)
|
property var _font: fontlist.get(selectedFontIndex)
|
||||||
property var _scaling: fontScalingList[selectedScalingIndex]
|
property int pixelSize: _font.pixelSize * scaling
|
||||||
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 lineSpacing: pixelSize * _font.lineSpacing
|
property int lineSpacing: pixelSize * _font.lineSpacing
|
||||||
property real screenScaling: 1.0
|
property real screenScaling: 1.0
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ ApplicationWindow{
|
|||||||
text: qsTr("Zoom In")
|
text: qsTr("Zoom In")
|
||||||
shortcut: "Ctrl++"
|
shortcut: "Ctrl++"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
var oldScaling = shadersettings.fontScalingIndexes[shadersettings.rasterization];
|
var oldScaling = shadersettings.fontScalingIndex;
|
||||||
var maxScalingIndex = shadersettings.fontScalingList.length - 1;
|
var maxScalingIndex = shadersettings.fontScalingList.length - 1;
|
||||||
shadersettings.setScalingIndex(Math.min(oldScaling + 1, maxScalingIndex));
|
shadersettings.setScalingIndex(Math.min(oldScaling + 1, maxScalingIndex));
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ ApplicationWindow{
|
|||||||
text: qsTr("Zoom Out")
|
text: qsTr("Zoom Out")
|
||||||
shortcut: "Ctrl+-"
|
shortcut: "Ctrl+-"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
var oldScaling = shadersettings.fontScalingIndexes[shadersettings.rasterization];
|
var oldScaling = shadersettings.fontScalingIndex;
|
||||||
shadersettings.setScalingIndex(Math.max(oldScaling - 1, 0));
|
shadersettings.setScalingIndex(Math.max(oldScaling - 1, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user