diff --git a/cool-old-term.pro b/cool-old-term.pro index 536ebad..f1dbee1 100644 --- a/cool-old-term.pro +++ b/cool-old-term.pro @@ -21,9 +21,28 @@ OTHER_FILES += \ $$PWD/qml/cool-old-term/HighlightArea.qml \ $$PWD/qml/cool-old-term/ShaderSettings.qml \ $$PWD/qml/images/frame.png \ - qml/cool-old-term/SettingsWindow.qml \ - qml/cool-old-term/SettingComponent.qml \ - qml/cool-old-term/ColorButton.qml \ - qml/cool-old-term/TerminalFrame.qml \ - qml/cool-old-term/WhiteFrameShader.qml \ - qml/cool-old-term/NoFrameShader.qml + $$PWD/qml/cool-old-term/SettingsWindow.qml \ + $$PWD/qml/cool-old-term/SettingComponent.qml \ + $$PWD/qml/cool-old-term/ColorButton.qml \ + $$PWD/qml/cool-old-term/TerminalFrame.qml \ + $$PWD/qml/cool-old-term/WhiteFrameShader.qml \ + $$PWD/qml/cool-old-term/NoFrameShader.qml \ + $$PWD/qml/cool-old-term/WhiteSimpleFrame.qml \ + qml/cool-old-term/BlackRoughFrame.qml \ + qml/cool-old-term/Frames/BlackRoughFrame.qml \ + qml/cool-old-term/Frames/NoFrameShader.qml \ + qml/cool-old-term/Frames/WhiteFrameShader.qml \ + qml/cool-old-term/Frames/WhiteSimpleFrame.qml \ + qml/cool-old-term/Frames/TerminalFrame.qml \ + qml/cool-old-term/Frames/utils/NoFrameShader.qml \ + qml/cool-old-term/Frames/utils/TerminalFrame.qml \ + qml/cool-old-term/Frames/utils/WhiteFrameShader.qml \ + qml/cool-old-term/frames/WhiteSimpleFrame.qml \ + qml/cool-old-term/frames/BlackRoughFrame.qml \ + qml/cool-old-term/frames/utils/NoFrameShader.qml \ + qml/cool-old-term/frames/utils/TerminalFrame.qml \ + qml/cool-old-term/frames/utils/WhiteFrameShader.qml \ + qml/cool-old-term/frames/images/screen-frame.png \ + qml/cool-old-term/frames/images/screen-frame-normals.png \ + qml/cool-old-term/frames/images/black-frame.png \ + qml/cool-old-term/frames/images/black-frame-normals.png diff --git a/qml/cool-old-term/ShaderSettings.qml b/qml/cool-old-term/ShaderSettings.qml index 6e77295..a08893b 100644 --- a/qml/cool-old-term/ShaderSettings.qml +++ b/qml/cool-old-term/ShaderSettings.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.1 Item{ property real ambient_light: 0.2 diff --git a/qml/cool-old-term/frames/BlackRoughFrame.qml b/qml/cool-old-term/frames/BlackRoughFrame.qml new file mode 100644 index 0000000..c166783 --- /dev/null +++ b/qml/cool-old-term/frames/BlackRoughFrame.qml @@ -0,0 +1,19 @@ +import QtQuick 2.1 +import "utils" + +TerminalFrame{ + id: frame + z: 2.1 + anchors.fill: parent + addedWidth: 200 + addedHeight: 370 + borderLeft: 148 + borderRight: 148 + borderTop: 232 + borderBottom: 232 + imageSource: "../images/black-frame.png" + normalsSource: "../images/black-frame-normals.png" + sourceRect: Qt.rect(-80, -90, terminal.width + 160, terminal.height + 180 ) + + shaderString: "WhiteFrameShader.qml" +} diff --git a/qml/cool-old-term/frames/WhiteSimpleFrame.qml b/qml/cool-old-term/frames/WhiteSimpleFrame.qml new file mode 100644 index 0000000..3f4191c --- /dev/null +++ b/qml/cool-old-term/frames/WhiteSimpleFrame.qml @@ -0,0 +1,19 @@ +import QtQuick 2.0 +import "utils" + +TerminalFrame{ + id: frame + z: 2.1 + anchors.fill: parent + addedWidth: 140 + addedHeight: 140 + borderLeft: 116 + borderRight: 116 + borderTop: 116 + borderBottom: 116 + imageSource: "../images/screen-frame.png" + normalsSource: "../images/screen-frame-normals.png" + sourceRect: Qt.rect(-65, -75, terminal.width + 130, terminal.height + 150) + + shaderString: "WhiteFrameShader.qml" +} diff --git a/qml/images/black-frame-normals.png b/qml/cool-old-term/frames/images/black-frame-normals.png similarity index 100% rename from qml/images/black-frame-normals.png rename to qml/cool-old-term/frames/images/black-frame-normals.png diff --git a/qml/images/black-frame.png b/qml/cool-old-term/frames/images/black-frame.png similarity index 100% rename from qml/images/black-frame.png rename to qml/cool-old-term/frames/images/black-frame.png diff --git a/qml/images/screen-frame-normals.png b/qml/cool-old-term/frames/images/screen-frame-normals.png similarity index 100% rename from qml/images/screen-frame-normals.png rename to qml/cool-old-term/frames/images/screen-frame-normals.png diff --git a/qml/images/screen-frame.png b/qml/cool-old-term/frames/images/screen-frame.png similarity index 100% rename from qml/images/screen-frame.png rename to qml/cool-old-term/frames/images/screen-frame.png diff --git a/qml/cool-old-term/NoFrameShader.qml b/qml/cool-old-term/frames/utils/NoFrameShader.qml similarity index 100% rename from qml/cool-old-term/NoFrameShader.qml rename to qml/cool-old-term/frames/utils/NoFrameShader.qml diff --git a/qml/cool-old-term/TerminalFrame.qml b/qml/cool-old-term/frames/utils/TerminalFrame.qml similarity index 100% rename from qml/cool-old-term/TerminalFrame.qml rename to qml/cool-old-term/frames/utils/TerminalFrame.qml diff --git a/qml/cool-old-term/WhiteFrameShader.qml b/qml/cool-old-term/frames/utils/WhiteFrameShader.qml similarity index 100% rename from qml/cool-old-term/WhiteFrameShader.qml rename to qml/cool-old-term/frames/utils/WhiteFrameShader.qml diff --git a/qml/cool-old-term/main.qml b/qml/cool-old-term/main.qml index 1798e87..792442c 100644 --- a/qml/cool-old-term/main.qml +++ b/qml/cool-old-term/main.qml @@ -180,7 +180,7 @@ ApplicationWindow{ //vec4 color = texture2D(source, coords); float color = (blurredColor(source, coords).r + texture2D(source, coords).r) * 0.5; float scanline_alpha = getScanlineIntensity(coords) * scanlines; - //float inside = step(0.0, coords.x) * step(-1.0, -coords.x) * step(0.0, coords.y) * step(-1.0, -coords.y); + //float inside = step(0.0, coords.x) * step(-1.0, -coords.x) * step(0.0, coords.y) * step(-1.0, -coords.y); float noise = stepNoise(coords) * noise_strength; float randomPass = randomPass(coords) * glowing_line_strength; color += noise + randomPass; @@ -190,38 +190,14 @@ ApplicationWindow{ }" } -// TerminalFrame{ -// id: frame -// z: 2.1 -// anchors.fill: parent -// addedWidth: 140 -// addedHeight: 140 -// borderLeft: 116 -// borderRight: 116 -// borderTop: 116 -// borderBottom: 116 -// imageSource: "../images/screen-frame.png" -// normalsSource: "../images/screen-frame-normals.png" -// sourceRect: Qt.rect(-65, -75, terminal.width + 130, terminal.height + 150) + Loader{ + property rect sourceRect -// shaderString: "WhiteFrameShader.qml" -// } - - TerminalFrame{ id: frame - z: 2.1 anchors.fill: parent - addedWidth: 200 - addedHeight: 370 - borderLeft: 148 - borderRight: 148 - borderTop: 232 - borderBottom: 232 - imageSource: "../images/black-frame.png" - normalsSource: "../images/black-frame-normals.png" - sourceRect: Qt.rect(-80, -90, terminal.width + 160, terminal.height + 180 ) - - shaderString: "WhiteFrameShader.qml" + z: 2.1 + source: "./frames/WhiteSimpleFrame.qml" + onLoaded: sourceRect = item.sourceRect; } TerminalScreen {