mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-22 12:58:39 +00:00
Some refactoring.
This commit is contained in:
parent
34f61cd86a
commit
5cb3c0c6ba
@ -50,6 +50,7 @@ ShaderEffect {
|
|||||||
_B * Math.sin(b * time + _C) +
|
_B * Math.sin(b * time + _C) +
|
||||||
_C * Math.cos(c * time + _A))
|
_C * Math.cos(c * time + _A))
|
||||||
|
|
||||||
|
|
||||||
property real brightness: screen_flickering * randval
|
property real brightness: screen_flickering * randval
|
||||||
property real horizontal_sincronization: shadersettings.horizontal_sincronization
|
property real horizontal_sincronization: shadersettings.horizontal_sincronization
|
||||||
property real _neg_sinc: 1 - horizontal_sincronization
|
property real _neg_sinc: 1 - horizontal_sincronization
|
||||||
|
@ -66,11 +66,11 @@ Item{
|
|||||||
onFont_scalingChanged: handleFontChanged();
|
onFont_scalingChanged: handleFontChanged();
|
||||||
|
|
||||||
function handleFontChanged(){
|
function handleFontChanged(){
|
||||||
terminal.source = "";
|
terminal.unloadKTerminal();
|
||||||
currentfont.source = fontlist.get(font_index).source;
|
currentfont.source = fontlist.get(font_index).source;
|
||||||
currentfont.pixelSize = fontlist.get(font_index).pixelSize;
|
currentfont.pixelSize = fontlist.get(font_index).pixelSize;
|
||||||
currentfont.lineSpacing = fontlist.get(font_index).lineSpacing;
|
currentfont.lineSpacing = fontlist.get(font_index).lineSpacing;
|
||||||
terminal.source = "Terminal.qml";
|
terminal.loadKTerminal();
|
||||||
}
|
}
|
||||||
|
|
||||||
FontLoader{
|
FontLoader{
|
||||||
|
@ -11,20 +11,20 @@ Item{
|
|||||||
property real _minBlurCoefficient: 0.015
|
property real _minBlurCoefficient: 0.015
|
||||||
property real _maxBlurCoefficient: 0.10
|
property real _maxBlurCoefficient: 0.10
|
||||||
|
|
||||||
function scrollUp(){
|
function loadKTerminal(){
|
||||||
kterminal.scrollUp();
|
kterminal.active = true;
|
||||||
|
}
|
||||||
|
function unloadKTerminal(){
|
||||||
|
kterminal.active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollDown(){
|
Loader{
|
||||||
kterminal.scrollDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
KTerminal {
|
|
||||||
id: kterminal
|
id: kterminal
|
||||||
|
active: false
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceComponent: KTerminal {
|
||||||
font.pointSize: shadersettings.fontSize
|
font.pointSize: shadersettings.fontSize
|
||||||
font.family: shadersettings.font.name
|
font.family: shadersettings.font.name
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
|
|
||||||
colorScheme: "MyWhiteOnBlack"
|
colorScheme: "MyWhiteOnBlack"
|
||||||
|
|
||||||
@ -45,13 +45,18 @@ Item{
|
|||||||
forceActiveFocus();
|
forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
acceptedButtons: Qt.NoButton
|
||||||
|
anchors.fill: parent
|
||||||
|
onWheel:
|
||||||
|
wheel.angleDelta.y > 0 ? kterminal.item.scrollUp() : kterminal.item.scrollDown()
|
||||||
|
}
|
||||||
ShaderEffectSource{
|
ShaderEffectSource{
|
||||||
id: source
|
id: source
|
||||||
sourceItem: kterminal
|
sourceItem: kterminal
|
||||||
hideSource: true
|
hideSource: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
active: mBlur !== 0
|
active: mBlur !== 0
|
||||||
@ -68,7 +73,6 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
id: blurredterminal
|
id: blurredterminal
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-03-30T17:53:23. -->
|
<!-- Written by QtCreator 3.0.1, 2014-03-30T21:12:33. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
|
37
app/main.qml
37
app/main.qml
@ -30,7 +30,9 @@ ApplicationWindow{
|
|||||||
width: 1024
|
width: 1024
|
||||||
height: 768
|
height: 768
|
||||||
|
|
||||||
title: qsTr("Terminal")
|
title: qsTr("cool-old-term")
|
||||||
|
visible: true
|
||||||
|
visibility: shadersettings.fullscreen ? Window.FullScreen : Window.Windowed
|
||||||
|
|
||||||
Action {
|
Action {
|
||||||
id: fullscreenAction
|
id: fullscreenAction
|
||||||
@ -52,7 +54,6 @@ ApplicationWindow{
|
|||||||
|
|
||||||
menuBar: MenuBar {
|
menuBar: MenuBar {
|
||||||
id: menubar
|
id: menubar
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
title: qsTr("File")
|
title: qsTr("File")
|
||||||
visible: shadersettings.fullscreen ? false : true
|
visible: shadersettings.fullscreen ? false : true
|
||||||
@ -66,50 +67,34 @@ ApplicationWindow{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: true
|
|
||||||
visibility: shadersettings.fullscreen ? Window.FullScreen : Window.Windowed
|
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id: maincontainer
|
id: maincontainer
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
clip: true
|
clip: true
|
||||||
|
Terminal{
|
||||||
|
id: terminal
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
}
|
||||||
ShaderEffectSource{
|
ShaderEffectSource{
|
||||||
id: theSource
|
id: theSource
|
||||||
sourceItem: terminal
|
sourceItem: terminal
|
||||||
sourceRect: frame.sourceRect
|
sourceRect: frame.sourceRect
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderManager{
|
ShaderManager{
|
||||||
id: shadercontainer
|
id: shadercontainer
|
||||||
anchors.fill: terminal
|
anchors.fill: terminal
|
||||||
blending: true
|
blending: true
|
||||||
z: 1.9
|
z: 1.9
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
|
id: frame
|
||||||
property rect sourceRect: item.sourceRect
|
property rect sourceRect: item.sourceRect
|
||||||
|
|
||||||
id: frame
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: 2.1
|
z: 2.1
|
||||||
source: shadersettings.frame_source
|
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{
|
RadialGradient{
|
||||||
id: ambientreflection
|
id: ambientreflection
|
||||||
z: 2.0
|
z: 2.0
|
||||||
@ -122,12 +107,10 @@ ApplicationWindow{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderSettings{
|
ShaderSettings{
|
||||||
id: shadersettings
|
id: shadersettings
|
||||||
Component.onCompleted: terminal.source = "Terminal.qml"
|
Component.onCompleted: terminal.loadKTerminal();
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsWindow{
|
SettingsWindow{
|
||||||
id: settingswindow
|
id: settingswindow
|
||||||
visible: false
|
visible: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user