mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-18 12:15:27 +00:00
added settings
This commit is contained in:
parent
f73e160a99
commit
3f41a9f2fc
@ -19,4 +19,6 @@ OTHER_FILES += \
|
|||||||
$$PWD/qml/cool-old-term/TerminalScreen.qml \
|
$$PWD/qml/cool-old-term/TerminalScreen.qml \
|
||||||
$$PWD/qml/cool-old-term/TerminalText.qml \
|
$$PWD/qml/cool-old-term/TerminalText.qml \
|
||||||
$$PWD/qml/cool-old-term/HighlightArea.qml \
|
$$PWD/qml/cool-old-term/HighlightArea.qml \
|
||||||
qml/cool-old-term/ShaderSettings.qml
|
$$PWD/qml/cool-old-term/ShaderSettings.qml \
|
||||||
|
$$PWD/qml/images/frame.png \
|
||||||
|
qml/cool-old-term/SettingsWindow.qml
|
||||||
|
134
qml/cool-old-term/SettingsWindow.qml
Normal file
134
qml/cool-old-term/SettingsWindow.qml
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
import QtQuick 2.1
|
||||||
|
import QtQuick.Controls 1.0
|
||||||
|
import QtQuick.Window 2.1
|
||||||
|
import QtQuick.Layouts 1.0
|
||||||
|
|
||||||
|
ApplicationWindow {
|
||||||
|
title: qsTr("Settings")
|
||||||
|
width: 640
|
||||||
|
height: 480
|
||||||
|
|
||||||
|
visible: true
|
||||||
|
modality: Qt.ApplicationModal
|
||||||
|
|
||||||
|
TabView{
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Tab{
|
||||||
|
title: qsTr("Settings")
|
||||||
|
anchors.fill: parent
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
GridLayout{
|
||||||
|
width: parent.width
|
||||||
|
columns: 2
|
||||||
|
Text{text: "Font color"}
|
||||||
|
Text{text: " ";
|
||||||
|
Rectangle{anchors.fill: parent; color: shadersettings.font_color}
|
||||||
|
MouseArea{anchors.fill: parent}
|
||||||
|
}
|
||||||
|
Text{text: "Backgroud color"}
|
||||||
|
Text{text: " "; Rectangle{anchors.fill: parent; color: shadersettings.background_color}}
|
||||||
|
}
|
||||||
|
|
||||||
|
GridLayout{
|
||||||
|
columns: 4
|
||||||
|
CheckBox{
|
||||||
|
id: noisecheck
|
||||||
|
onCheckedChanged:
|
||||||
|
if(checked) shadersettings.noise_strength = noiseslider.value;
|
||||||
|
else shadersettings.noise_strength = 0;
|
||||||
|
Component.onCompleted: checked = shadersettings.noise_strength !== 0;
|
||||||
|
}
|
||||||
|
Text{
|
||||||
|
text: qsTr("Noise")
|
||||||
|
}
|
||||||
|
Slider{
|
||||||
|
id: noiseslider
|
||||||
|
stepSize: 0.01
|
||||||
|
minimumValue: 0.0
|
||||||
|
maximumValue: 1.0
|
||||||
|
onValueChanged: shadersettings.noise_strength = value;
|
||||||
|
Component.onCompleted: value = shadersettings.noise_strength;
|
||||||
|
}
|
||||||
|
TextArea{
|
||||||
|
text: noiseslider.value.toFixed(2);
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CheckBox{
|
||||||
|
id: glowcheck
|
||||||
|
onCheckedChanged:
|
||||||
|
if(checked) shadersettings.glowing_line_strength = glowslider.value;
|
||||||
|
else shadersettings.glowing_line_strength = 0;
|
||||||
|
Component.onCompleted: checked = shadersettings.glowing_line_strength !== 0;
|
||||||
|
}
|
||||||
|
Text{
|
||||||
|
text: qsTr("Glow")
|
||||||
|
}
|
||||||
|
Slider{
|
||||||
|
id: glowslider
|
||||||
|
stepSize: 0.01
|
||||||
|
minimumValue: 0.0
|
||||||
|
maximumValue: 1.0
|
||||||
|
onValueChanged: shadersettings.glowing_line_strength = value;
|
||||||
|
Component.onCompleted: value = shadersettings.glowing_line_strength;
|
||||||
|
}
|
||||||
|
TextArea{
|
||||||
|
text: glowslider.value.toFixed(2);
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CheckBox{
|
||||||
|
id: ambientcheck
|
||||||
|
onCheckedChanged:
|
||||||
|
if(checked) shadersettings.ambient_light = ambientslider.value;
|
||||||
|
else shadersettings.ambient_light = 0;
|
||||||
|
Component.onCompleted: checked = shadersettings.ambient_light !== 0;
|
||||||
|
}
|
||||||
|
Text{
|
||||||
|
text: qsTr("Ambient light")
|
||||||
|
}
|
||||||
|
Slider{
|
||||||
|
id: ambientslider
|
||||||
|
stepSize: 0.01
|
||||||
|
minimumValue: 0.1
|
||||||
|
maximumValue: 0.5
|
||||||
|
onValueChanged: shadersettings.ambient_light = value;
|
||||||
|
Component.onCompleted: value = shadersettings.ambient_light;
|
||||||
|
}
|
||||||
|
TextArea{
|
||||||
|
text: ambientslider.value.toFixed(2);
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
|
||||||
|
// CheckBox{
|
||||||
|
// id: distortioncheck
|
||||||
|
// onCheckedChanged:
|
||||||
|
// if(checked) shadersettings.screen_distortion = distortionslider.value;
|
||||||
|
// else shadersettings.screen_distortion = 0;
|
||||||
|
// Component.onCompleted: checked = shadersettings.screen_distortion !== 0;
|
||||||
|
// }
|
||||||
|
// Text{
|
||||||
|
// text: qsTr("Distortion")
|
||||||
|
// }
|
||||||
|
// Slider{
|
||||||
|
// id: distortionslider
|
||||||
|
// stepSize: 0.01
|
||||||
|
// minimumValue: 0.0
|
||||||
|
// maximumValue: 1.0
|
||||||
|
// onValueChanged: shadersettings.screen_distortion = value;
|
||||||
|
// Component.onCompleted: value = shadersettings.screen_distortion;
|
||||||
|
// }
|
||||||
|
// TextArea{
|
||||||
|
// text: distortionslider.value.toFixed(2);
|
||||||
|
// enabled: false
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -38,10 +38,21 @@ ApplicationWindow{
|
|||||||
|
|
||||||
menuBar: MenuBar {
|
menuBar: MenuBar {
|
||||||
Menu {
|
Menu {
|
||||||
title: "File"
|
title: qsTr("File")
|
||||||
MenuItem { text: "Open..." }
|
MenuItem { text: "Close"; onTriggered: mainwindow.close()}
|
||||||
MenuItem { text: "Close" }
|
|
||||||
}
|
}
|
||||||
|
Menu {
|
||||||
|
title: qsTr("Edit")
|
||||||
|
MenuItem {
|
||||||
|
text: qsTr("Settings")
|
||||||
|
onTriggered: {
|
||||||
|
var component = Qt.createComponent("SettingsWindow.qml");
|
||||||
|
component.createObject(mainwindow);
|
||||||
|
component.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,6 +82,8 @@ ApplicationWindow{
|
|||||||
property real noise_strength: shadersettings.noise_strength
|
property real noise_strength: shadersettings.noise_strength
|
||||||
property real screen_distorsion: shadersettings.screen_distortion
|
property real screen_distorsion: shadersettings.screen_distortion
|
||||||
property real glowing_line_strength: shadersettings.glowing_line_strength
|
property real glowing_line_strength: shadersettings.glowing_line_strength
|
||||||
|
property real brightness: 1.0
|
||||||
|
|
||||||
property real deltay: 1.0 / terminal.height
|
property real deltay: 1.0 / terminal.height
|
||||||
property real deltax: 1.0 / terminal.width
|
property real deltax: 1.0 / terminal.width
|
||||||
//property real faulty_screen_prob: shadersettings.faulty_screen_prob
|
//property real faulty_screen_prob: shadersettings.faulty_screen_prob
|
||||||
@ -92,9 +105,11 @@ ApplicationWindow{
|
|||||||
|
|
||||||
uniform highp vec4 font_color;
|
uniform highp vec4 font_color;
|
||||||
uniform highp vec4 background_color;
|
uniform highp vec4 background_color;
|
||||||
|
|
||||||
uniform highp float noise_strength;
|
uniform highp float noise_strength;
|
||||||
uniform highp float screen_distorsion;
|
uniform highp float screen_distorsion;
|
||||||
uniform highp float glowing_line_strength;
|
uniform highp float glowing_line_strength;
|
||||||
|
|
||||||
uniform highp float deltax;
|
uniform highp float deltax;
|
||||||
uniform highp float deltay;
|
uniform highp float deltay;
|
||||||
|
|
||||||
@ -162,7 +177,7 @@ ApplicationWindow{
|
|||||||
|
|
||||||
Image{
|
Image{
|
||||||
id: frame
|
id: frame
|
||||||
source: "/home/swordfish/Pictures/frame.png"
|
source: "../images/frame.png"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width * 1.05
|
width: parent.width * 1.05
|
||||||
height: parent.height * 1.05
|
height: parent.height * 1.05
|
||||||
|
Loading…
x
Reference in New Issue
Block a user