From cc72a28ee34ca5fa384f6be0826d36ad89aa0d69 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Tue, 30 Sep 2014 00:10:14 +0200 Subject: [PATCH] Updating sources when font settings are changed. --- app/qml/PreprocessedTerminal.qml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/qml/PreprocessedTerminal.qml b/app/qml/PreprocessedTerminal.qml index ae696c8..49f9b84 100644 --- a/app/qml/PreprocessedTerminal.qml +++ b/app/qml/PreprocessedTerminal.qml @@ -77,6 +77,23 @@ Item{ kterminal.copyClipboard(); } + //When settings are updated sources need to be redrawn. + Connections{ + target: shadersettings + onFontScalingChanged: terminalContainer.updateSources(); + onFontWidthChanged: terminalContainer.updateSources(); + } + Connections{ + target: terminalContainer + onWidthChanged: terminalContainer.updateSources(); + onHeightChanged: terminalContainer.updateSources(); + } + function updateSources() { + kterminal.update(); + kterminal.updateImage(); + } + + KTerminal { id: kterminal width: parent.width @@ -95,9 +112,6 @@ Item{ } } - onWidthChanged: update(); - onHeightChanged: update(); - FontLoader{ id: fontLoader } Text{id: fontMetrics; text: "B"; visible: false}