diff --git a/app/ShaderManager.qml b/app/ShaderManager.qml index 6bd82cf..69569bb 100644 --- a/app/ShaderManager.qml +++ b/app/ShaderManager.qml @@ -50,6 +50,7 @@ ShaderEffect { _B * Math.sin(b * time + _C) + _C * Math.cos(c * time + _A)) + property real brightness: screen_flickering * randval property real horizontal_sincronization: shadersettings.horizontal_sincronization property real _neg_sinc: 1 - horizontal_sincronization diff --git a/app/ShaderSettings.qml b/app/ShaderSettings.qml index ae8c12a..df6d657 100644 --- a/app/ShaderSettings.qml +++ b/app/ShaderSettings.qml @@ -66,11 +66,11 @@ Item{ onFont_scalingChanged: handleFontChanged(); function handleFontChanged(){ - terminal.source = ""; + terminal.unloadKTerminal(); currentfont.source = fontlist.get(font_index).source; currentfont.pixelSize = fontlist.get(font_index).pixelSize; currentfont.lineSpacing = fontlist.get(font_index).lineSpacing; - terminal.source = "Terminal.qml"; + terminal.loadKTerminal(); } FontLoader{ diff --git a/app/Terminal.qml b/app/Terminal.qml index 6a2e6dc..da98347 100644 --- a/app/Terminal.qml +++ b/app/Terminal.qml @@ -11,47 +11,52 @@ Item{ property real _minBlurCoefficient: 0.015 property real _maxBlurCoefficient: 0.10 - function scrollUp(){ - kterminal.scrollUp(); + function loadKTerminal(){ + kterminal.active = true; + } + function unloadKTerminal(){ + kterminal.active = false; } - function scrollDown(){ - kterminal.scrollDown(); - } - - KTerminal { + Loader{ id: kterminal - font.pointSize: shadersettings.fontSize - font.family: shadersettings.font.name - width: parent.width - height: parent.height + active: false + anchors.fill: parent + sourceComponent: KTerminal { + font.pointSize: shadersettings.fontSize + font.family: shadersettings.font.name - colorScheme: "MyWhiteOnBlack" + colorScheme: "MyWhiteOnBlack" - session: KSession { - id: ksession - kbScheme: "linux" + session: KSession { + id: ksession + kbScheme: "linux" - onFinished: { - Qt.quit() + onFinished: { + Qt.quit() + } + } + + onUpdatedImage: {blurredSource.live = true;livetimer.restart();} + + Component.onCompleted: { + font.pointSize = shadersettings.fontSize; + font.family = shadersettings.font.name; + forceActiveFocus(); } } - - onUpdatedImage: {blurredSource.live = true;livetimer.restart();} - - Component.onCompleted: { - font.pointSize = shadersettings.fontSize; - font.family = shadersettings.font.name; - forceActiveFocus(); - } } - + MouseArea{ + acceptedButtons: Qt.NoButton + anchors.fill: parent + onWheel: + wheel.angleDelta.y > 0 ? kterminal.item.scrollUp() : kterminal.item.scrollDown() + } ShaderEffectSource{ id: source sourceItem: kterminal hideSource: true } - Loader{ anchors.fill: parent active: mBlur !== 0 @@ -68,7 +73,6 @@ Item{ } } } - ShaderEffect { id: blurredterminal anchors.fill: parent diff --git a/app/app.qmlproject.user b/app/app.qmlproject.user index 9045ed6..f8461ca 100644 --- a/app/app.qmlproject.user +++ b/app/app.qmlproject.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/app/main.qml b/app/main.qml index 5e46a12..c465bbb 100644 --- a/app/main.qml +++ b/app/main.qml @@ -30,7 +30,9 @@ ApplicationWindow{ width: 1024 height: 768 - title: qsTr("Terminal") + title: qsTr("cool-old-term") + visible: true + visibility: shadersettings.fullscreen ? Window.FullScreen : Window.Windowed Action { id: fullscreenAction @@ -52,7 +54,6 @@ ApplicationWindow{ menuBar: MenuBar { id: menubar - Menu { title: qsTr("File") visible: shadersettings.fullscreen ? false : true @@ -66,50 +67,34 @@ ApplicationWindow{ } } - visible: true - visibility: shadersettings.fullscreen ? Window.FullScreen : Window.Windowed - Item{ id: maincontainer anchors.fill: parent clip: true - + Terminal{ + id: terminal + width: parent.width + height: parent.height + } ShaderEffectSource{ id: theSource sourceItem: terminal sourceRect: frame.sourceRect } - ShaderManager{ id: shadercontainer anchors.fill: terminal blending: true z: 1.9 } - Loader{ + id: frame property rect sourceRect: item.sourceRect - id: frame anchors.fill: parent z: 2.1 source: shadersettings.frame_source } - - Loader{ - id: terminal - - width: parent.width - height: parent.height - } - - MouseArea{ - acceptedButtons: Qt.NoButton - anchors.fill: parent - onWheel: - wheel.angleDelta.y > 0 ? terminal.item.scrollUp() : terminal.item.scrollDown() - } - RadialGradient{ id: ambientreflection z: 2.0 @@ -122,12 +107,10 @@ ApplicationWindow{ } } } - ShaderSettings{ id: shadersettings - Component.onCompleted: terminal.source = "Terminal.qml" + Component.onCompleted: terminal.loadKTerminal(); } - SettingsWindow{ id: settingswindow visible: false