mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-07 05:31:24 +00:00
Refactoring: avoid manually defined bindings in font changed handler.
This commit is contained in:
parent
ebc2246901
commit
ebbaec762d
@ -31,6 +31,8 @@ Item{
|
|||||||
property ShaderEffectSource mainSource: kterminalSource
|
property ShaderEffectSource mainSource: kterminalSource
|
||||||
property ShaderEffectSource blurredSource: blurredSourceLoader.item
|
property ShaderEffectSource blurredSource: blurredSourceLoader.item
|
||||||
|
|
||||||
|
property real fontWidth: 1.0
|
||||||
|
property real screenScaling: 1.0
|
||||||
property real scaleTexture: 1.0
|
property real scaleTexture: 1.0
|
||||||
property alias title: ksession.title
|
property alias title: ksession.title
|
||||||
property alias kterminal: kterminal
|
property alias kterminal: kterminal
|
||||||
@ -76,8 +78,8 @@ Item{
|
|||||||
|
|
||||||
QMLTermWidget {
|
QMLTermWidget {
|
||||||
id: kterminal
|
id: kterminal
|
||||||
width: parent.width
|
width: Math.floor(parent.width / (screenScaling * fontWidth))
|
||||||
height: parent.height
|
height: Math.floor(parent.height / screenScaling)
|
||||||
|
|
||||||
colorScheme: "cool-retro-term"
|
colorScheme: "cool-retro-term"
|
||||||
|
|
||||||
@ -113,9 +115,8 @@ Item{
|
|||||||
font.pixelSize = pixelSize;
|
font.pixelSize = pixelSize;
|
||||||
font.family = fontLoader.name;
|
font.family = fontLoader.name;
|
||||||
|
|
||||||
width = Qt.binding(function() {return Math.floor(terminalContainer.width / (screenScaling * fontWidth));});
|
terminalContainer.fontWidth = fontWidth;
|
||||||
height = Qt.binding(function() {return Math.floor(terminalContainer.height / screenScaling);});
|
terminalContainer.screenScaling= screenScaling;
|
||||||
|
|
||||||
scaleTexture = Math.max(1.0, Math.round(screenScaling / 2));
|
scaleTexture = Math.max(1.0, Math.round(screenScaling / 2));
|
||||||
|
|
||||||
kterminal.lineSpacing = lineSpacing;
|
kterminal.lineSpacing = lineSpacing;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user