2021-06-30 22:49:03 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2013-2021 "Filippo Scognamiglio"
|
|
|
|
* https://github.com/Swordfish90/cool-retro-term
|
|
|
|
*
|
|
|
|
* This file is part of cool-retro-term.
|
|
|
|
*
|
|
|
|
* cool-retro-term is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*******************************************************************************/
|
2014-10-11 01:24:20 +02:00
|
|
|
import QtQuick 2.2
|
2014-12-11 10:40:14 +01:00
|
|
|
import QtGraphicalEffects 1.0
|
2014-10-11 01:24:20 +02:00
|
|
|
|
2015-01-05 21:47:42 +01:00
|
|
|
import "utils.js" as Utils
|
|
|
|
|
2018-11-07 22:36:51 +01:00
|
|
|
ShaderTerminal {
|
2014-10-27 09:28:27 +02:00
|
|
|
property alias title: terminal.title
|
2014-12-14 12:02:40 +01:00
|
|
|
property alias terminalSize: terminal.terminalSize
|
2014-10-27 09:28:27 +02:00
|
|
|
|
2021-07-03 16:14:02 +02:00
|
|
|
property real devicePixelRatio: terminalWindow.screen.devicePixelRatio
|
|
|
|
|
2014-12-11 10:07:53 +01:00
|
|
|
id: mainShader
|
2014-12-11 12:08:15 +01:00
|
|
|
opacity: appSettings.windowOpacity * 0.3 + 0.7
|
2014-10-11 01:24:20 +02:00
|
|
|
|
2014-12-14 10:31:38 +01:00
|
|
|
source: terminal.mainSource
|
2018-11-07 22:36:51 +01:00
|
|
|
burnInEffect: terminal.burnInEffect
|
2021-07-03 16:14:02 +02:00
|
|
|
virtualResolution: terminal.virtualResolution
|
|
|
|
screenResolution: Qt.size(
|
|
|
|
terminalWindow.width * devicePixelRatio * appSettings.windowScaling,
|
|
|
|
terminalWindow.height * devicePixelRatio * appSettings.windowScaling
|
|
|
|
)
|
2014-12-14 10:31:38 +01:00
|
|
|
|
2021-06-30 22:49:03 +02:00
|
|
|
TimeManager {
|
2018-11-07 22:36:51 +01:00
|
|
|
id: timeManager
|
|
|
|
enableTimer: terminalWindow.visible
|
|
|
|
}
|
|
|
|
|
2021-06-30 22:49:03 +02:00
|
|
|
PreprocessedTerminal {
|
2014-12-11 01:48:30 +01:00
|
|
|
id: terminal
|
|
|
|
anchors.fill: parent
|
2014-10-11 01:24:20 +02:00
|
|
|
}
|
2014-12-11 10:07:53 +01:00
|
|
|
|
2014-12-11 10:40:14 +01:00
|
|
|
// EFFECTS ////////////////////////////////////////////////////////////////
|
2021-06-30 22:49:03 +02:00
|
|
|
Loader {
|
2014-12-11 10:40:14 +01:00
|
|
|
id: bloomEffectLoader
|
2014-12-23 18:13:34 +01:00
|
|
|
active: appSettings.bloom
|
2014-12-11 10:40:14 +01:00
|
|
|
asynchronous: true
|
2014-12-23 18:13:34 +01:00
|
|
|
width: parent.width * appSettings.bloomQuality
|
|
|
|
height: parent.height * appSettings.bloomQuality
|
2015-01-05 21:47:42 +01:00
|
|
|
|
2021-06-30 22:49:03 +02:00
|
|
|
sourceComponent: FastBlur {
|
|
|
|
radius: Utils.lint(16, 64, appSettings.bloomQuality)
|
2015-01-05 21:47:42 +01:00
|
|
|
source: terminal.mainSource
|
2014-12-11 10:40:14 +01:00
|
|
|
transparentBorder: true
|
|
|
|
}
|
|
|
|
}
|
2021-06-30 22:49:03 +02:00
|
|
|
Loader {
|
2014-12-11 10:40:14 +01:00
|
|
|
id: bloomSourceLoader
|
2014-12-23 18:13:34 +01:00
|
|
|
active: appSettings.bloom !== 0
|
2014-12-11 10:40:14 +01:00
|
|
|
asynchronous: true
|
2021-06-30 22:49:03 +02:00
|
|
|
sourceComponent: ShaderEffectSource {
|
2014-12-11 10:40:14 +01:00
|
|
|
id: _bloomEffectSource
|
|
|
|
sourceItem: bloomEffectLoader.item
|
|
|
|
hideSource: true
|
|
|
|
smooth: true
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bloomSource: bloomSourceLoader.item
|
2014-10-11 01:24:20 +02:00
|
|
|
}
|