2020
2121import QtQuick 2.2
2222import QtQuick.Controls 2.0
23- import QtQml
2423
2524import QMLTermWidget 2.0
2625
2726import "menus"
2827import "utils.js" as Utils
2928
30- Item {
31- id: preprocessedTerminal
29+ Item {
30+ id: terminalContainer
3231 signal sessionFinished ()
3332
3433 property size virtualResolution: Qt .size (kterminal .totalWidth , kterminal .totalHeight )
@@ -48,14 +47,14 @@ Item {
4847 // Manage copy and paste
4948 Connections {
5049 target: copyAction
51- enabled : terminalContainer . hasFocus
50+
5251 onTriggered: {
5352 kterminal .copyClipboard ()
5453 }
5554 }
5655 Connections {
5756 target: pasteAction
58- enabled : terminalContainer . hasFocus
57+
5958 onTriggered: {
6059 kterminal .pasteClipboard ()
6160 }
@@ -66,22 +65,22 @@ Item {
6665 target: appSettings
6766
6867 onFontScalingChanged: {
69- preprocessedTerminal .updateSources ()
68+ terminalContainer .updateSources ()
7069 }
7170
7271 onFontWidthChanged: {
73- preprocessedTerminal .updateSources ()
72+ terminalContainer .updateSources ()
7473 }
7574 }
7675 Connections {
77- target: preprocessedTerminal
76+ target: terminalContainer
7877
7978 onWidthChanged: {
80- preprocessedTerminal .updateSources ()
79+ terminalContainer .updateSources ()
8180 }
8281
8382 onHeightChanged: {
84- preprocessedTerminal .updateSources ()
83+ terminalContainer .updateSources ()
8584 }
8685 }
8786
@@ -119,7 +118,7 @@ Item {
119118 id: ksession
120119
121120 onFinished: {
122- preprocessedTerminal .sessionFinished ()
121+ terminalContainer .sessionFinished ()
123122 }
124123 }
125124
@@ -149,16 +148,16 @@ Item {
149148 pixelSize: pixelSize
150149 });
151150
152- preprocessedTerminal .fontWidth = fontWidth;
153- preprocessedTerminal .screenScaling = screenScaling;
151+ terminalContainer .fontWidth = fontWidth;
152+ terminalContainer .screenScaling = screenScaling;
154153 scaleTexture = Math .max (1.0 , Math .floor (screenScaling * appSettings .windowScaling ));
155154 }
156155
157156 Connections {
158157 target: appSettings
159158
160159 onWindowScalingChanged: {
161- scaleTexture = Math .max (1.0 , Math .floor (preprocessedTerminal .screenScaling * appSettings .windowScaling ));
160+ scaleTexture = Math .max (1.0 , Math .floor (terminalContainer .screenScaling * appSettings .windowScaling ));
162161 }
163162 }
164163
@@ -187,6 +186,9 @@ Item {
187186 appSettings .fontManager .refresh ()
188187 startSession ();
189188 }
189+ Component .onDestruction : {
190+ appSettings .fontManager .terminalFontChanged .disconnect (handleFontChanged);
191+ }
190192 }
191193
192194 Component {
@@ -214,7 +216,7 @@ Item {
214216 cursorShape: kterminal .terminalUsesMouse ? Qt .ArrowCursor : Qt .IBeamCursor
215217 onWheel : function (wheel ) {
216218 if (wheel .modifiers & Qt .ControlModifier ) {
217- wheel .angleDelta .y > 0 ? zoomInAction .trigger () : zoomOutAction .trigger ();
219+ wheel .angleDelta .y > 0 ? zoomIn .trigger () : zoomOut .trigger ();
218220 } else {
219221 var coord = correctDistortion (wheel .x , wheel .y );
220222 kterminal .simulateWheel (coord .x , coord .y , wheel .buttons , wheel .modifiers , wheel .angleDelta );
0 commit comments