2013-12-28 14:52:10 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2013 "Filippo Scognamiglio"
|
|
|
|
* https://github.com/Swordifish90/cool-old-term
|
|
|
|
*
|
|
|
|
* This file is part of cool-old-term.
|
|
|
|
*
|
|
|
|
* cool-old-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-04-17 13:56:13 +02:00
|
|
|
import QtQuick 2.2
|
|
|
|
import QtQuick.Controls 1.1
|
2013-11-25 19:05:31 +01:00
|
|
|
import QtQuick.Window 2.1
|
2014-04-17 13:56:13 +02:00
|
|
|
import QtQuick.Layouts 1.1
|
2013-12-22 18:32:01 +01:00
|
|
|
import QtQuick.Dialogs 1.1
|
2013-11-25 19:05:31 +01:00
|
|
|
|
2014-04-17 13:56:13 +02:00
|
|
|
Window {
|
2013-12-22 18:32:01 +01:00
|
|
|
id: settings_window
|
2013-11-25 19:05:31 +01:00
|
|
|
title: qsTr("Settings")
|
|
|
|
width: 640
|
2014-04-20 22:59:46 +02:00
|
|
|
height: 480
|
2013-11-25 19:05:31 +01:00
|
|
|
|
2014-04-03 15:06:16 +02:00
|
|
|
modality: Qt.ApplicationModal
|
2013-11-25 19:05:31 +01:00
|
|
|
|
|
|
|
TabView{
|
|
|
|
anchors.fill: parent
|
2014-04-03 15:06:16 +02:00
|
|
|
anchors.margins: 10
|
2013-11-25 19:05:31 +01:00
|
|
|
Tab{
|
2013-12-28 02:19:16 +01:00
|
|
|
title: qsTr("Appearance")
|
2014-04-03 15:06:16 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 15
|
2013-12-28 02:19:16 +01:00
|
|
|
GridLayout{
|
2013-11-25 19:05:31 +01:00
|
|
|
anchors.fill: parent
|
2013-12-28 02:19:16 +01:00
|
|
|
columns: 2
|
|
|
|
GroupBox{
|
2014-04-03 15:06:16 +02:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2013-12-28 02:19:16 +01:00
|
|
|
Layout.columnSpan: 2
|
|
|
|
title: qsTr("Profile")
|
2014-05-18 22:23:19 +02:00
|
|
|
RowLayout{
|
2013-12-28 02:19:16 +01:00
|
|
|
anchors.fill: parent
|
2014-05-18 22:23:19 +02:00
|
|
|
ComboBox{
|
|
|
|
id: profilesbox
|
|
|
|
Layout.fillWidth: true
|
|
|
|
model: shadersettings.profiles_list
|
|
|
|
currentIndex: shadersettings.profiles_index
|
|
|
|
}
|
|
|
|
Button{
|
|
|
|
text: "Load"
|
|
|
|
onClicked: shadersettings.profiles_index = profilesbox.currentIndex
|
|
|
|
}
|
|
|
|
Button{
|
|
|
|
text: "Add"
|
|
|
|
onClicked: insertname.show()
|
|
|
|
}
|
|
|
|
Button{
|
|
|
|
text: "Remove"
|
|
|
|
enabled: !shadersettings.profiles_list.get(profilesbox.currentIndex).builtin
|
|
|
|
onClicked: {
|
|
|
|
shadersettings.profiles_list.remove(profilesbox.currentIndex)
|
|
|
|
profilesbox.currentIndex = profilesbox.currentIndex - 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
InsertNameDialog{
|
|
|
|
id: insertname
|
|
|
|
onNameSelected: shadersettings.addNewCustomProfile(name)
|
|
|
|
}
|
2013-12-26 01:12:14 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-28 02:19:16 +01:00
|
|
|
GroupBox{
|
|
|
|
id: fontbox
|
|
|
|
title: qsTr("Font")
|
2014-04-03 15:06:16 +02:00
|
|
|
Layout.fillHeight: true
|
2013-12-28 02:19:16 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
GridLayout{
|
|
|
|
anchors.fill: parent
|
|
|
|
columns: 2
|
|
|
|
Text{text: qsTr("Font style:")}
|
|
|
|
ComboBox{
|
|
|
|
Layout.fillWidth: true
|
|
|
|
model: shadersettings.fonts_list
|
|
|
|
currentIndex: shadersettings.font_index
|
|
|
|
onCurrentIndexChanged: shadersettings.font_index = currentIndex
|
|
|
|
}
|
|
|
|
Text{text: qsTr("Font scaling:")}
|
2013-12-28 02:42:24 +01:00
|
|
|
SpinBox{
|
2013-12-28 02:19:16 +01:00
|
|
|
Layout.fillWidth: true
|
2014-05-29 01:13:31 +02:00
|
|
|
decimals: 2
|
|
|
|
stepSize: 0.25
|
2013-12-28 03:40:45 +01:00
|
|
|
value: shadersettings.font_scaling
|
2013-12-28 02:42:24 +01:00
|
|
|
minimumValue: 0.5
|
2014-05-29 01:13:31 +02:00
|
|
|
maximumValue: 2.0
|
2013-12-28 02:42:24 +01:00
|
|
|
onValueChanged: shadersettings.font_scaling = value;
|
2013-12-28 02:19:16 +01:00
|
|
|
}
|
|
|
|
Item{Layout.fillHeight: true}
|
2013-12-23 00:13:47 +01:00
|
|
|
ColorButton{
|
2013-12-28 02:19:16 +01:00
|
|
|
height: 50
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.columnSpan: 2
|
2014-03-27 13:59:48 +01:00
|
|
|
onButton_colorChanged: shadersettings._font_color = button_color;
|
2014-03-31 22:23:48 +02:00
|
|
|
button_color: shadersettings._font_color;
|
2013-12-22 18:32:01 +01:00
|
|
|
}
|
2013-11-25 19:05:31 +01:00
|
|
|
}
|
2013-12-28 02:19:16 +01:00
|
|
|
}
|
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Background")
|
2014-04-03 15:06:16 +02:00
|
|
|
Layout.fillHeight: true
|
2013-12-28 02:19:16 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
GridLayout{
|
|
|
|
anchors.fill: parent
|
|
|
|
columns: 2
|
|
|
|
Text{text: "Frame texture"}
|
|
|
|
ComboBox{
|
2014-04-05 15:14:52 +02:00
|
|
|
id: framescombobox
|
2013-12-28 02:19:16 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
model: shadersettings.frames_list
|
|
|
|
currentIndex: shadersettings.frames_index
|
|
|
|
onCurrentIndexChanged: shadersettings.frames_index = currentIndex
|
|
|
|
}
|
2014-04-05 15:14:52 +02:00
|
|
|
CheckBox{
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
Layout.fillWidth: true
|
|
|
|
checked: shadersettings.frame_reflections
|
|
|
|
text: qsTr("Frame reflections")
|
|
|
|
onCheckedChanged: shadersettings.frame_reflections = checked
|
|
|
|
enabled: framescombobox.model.get(framescombobox.currentIndex).reflections
|
|
|
|
}
|
|
|
|
|
2013-12-28 02:19:16 +01:00
|
|
|
Item{Layout.fillHeight: true}
|
2013-12-23 00:13:47 +01:00
|
|
|
ColorButton{
|
2013-12-28 02:19:16 +01:00
|
|
|
height: 50
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.columnSpan: 2
|
2013-12-23 00:13:47 +01:00
|
|
|
|
2014-03-27 13:59:48 +01:00
|
|
|
onButton_colorChanged: shadersettings._background_color= button_color
|
2014-03-31 22:23:48 +02:00
|
|
|
button_color: shadersettings._background_color;
|
2014-03-27 13:59:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupBox{
|
2014-04-03 15:06:16 +02:00
|
|
|
title: qsTr("Lights")
|
2014-03-27 13:59:48 +01:00
|
|
|
Layout.fillWidth: true
|
2014-03-31 22:23:48 +02:00
|
|
|
Layout.columnSpan: 2
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2014-04-03 15:06:16 +02:00
|
|
|
GridLayout{
|
2014-03-31 22:23:48 +02:00
|
|
|
Layout.columnSpan: 2
|
2014-04-03 15:06:16 +02:00
|
|
|
columns: 2
|
|
|
|
rows: 2
|
2014-03-31 22:23:48 +02:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2014-04-03 15:06:16 +02:00
|
|
|
Text{text: qsTr("Contrast")}
|
2014-03-31 22:23:48 +02:00
|
|
|
SimpleSlider{
|
2014-03-27 13:59:48 +01:00
|
|
|
onValueChanged: shadersettings.contrast = value
|
2014-03-31 22:23:48 +02:00
|
|
|
value: shadersettings.contrast
|
2013-12-22 18:32:01 +01:00
|
|
|
}
|
2014-04-03 15:06:16 +02:00
|
|
|
Text{text: qsTr("Brightness")}
|
2014-03-31 22:23:48 +02:00
|
|
|
SimpleSlider{
|
2014-03-31 17:26:51 +02:00
|
|
|
onValueChanged: shadersettings.brightness = value
|
2014-03-31 22:23:48 +02:00
|
|
|
value: shadersettings.brightness
|
2014-03-31 17:26:51 +02:00
|
|
|
}
|
2013-12-22 18:32:01 +01:00
|
|
|
}
|
2013-11-25 19:05:31 +01:00
|
|
|
}
|
2014-04-03 18:44:23 +02:00
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Performace")
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2014-04-20 22:59:46 +02:00
|
|
|
GridLayout{
|
|
|
|
columns: 3
|
2014-04-03 18:44:23 +02:00
|
|
|
Layout.columnSpan: 2
|
2014-04-20 22:59:46 +02:00
|
|
|
anchors {left: parent.left; right: parent.right}
|
2014-04-03 18:44:23 +02:00
|
|
|
Text{text: "Animation FPS"}
|
|
|
|
Slider{
|
|
|
|
Layout.fillWidth: true
|
|
|
|
id: slider
|
|
|
|
stepSize: 1
|
|
|
|
maximumValue: 60
|
|
|
|
minimumValue: 0
|
|
|
|
onValueChanged: shadersettings.fps = value;
|
|
|
|
value: shadersettings.fps
|
|
|
|
}
|
2014-04-20 22:59:46 +02:00
|
|
|
Text{text: slider.value}
|
|
|
|
Text{text: "Texture quality"}
|
|
|
|
Slider{
|
|
|
|
Layout.fillWidth: true
|
|
|
|
id: txtslider
|
|
|
|
stepSize: 0.01
|
|
|
|
maximumValue: 1
|
|
|
|
minimumValue: 0
|
|
|
|
onValueChanged: shadersettings.window_scaling = value;
|
|
|
|
value: shadersettings.window_scaling
|
|
|
|
updateValueWhileDragging: false
|
2014-04-03 18:44:23 +02:00
|
|
|
}
|
2014-04-20 22:59:46 +02:00
|
|
|
Text{text: Math.round(txtslider.value * 100) + "%"}
|
2014-04-03 18:44:23 +02:00
|
|
|
}
|
|
|
|
}
|
2013-12-28 02:19:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Tab{
|
|
|
|
title: qsTr("Eye-candy")
|
|
|
|
anchors.fill: parent
|
2014-04-03 15:06:16 +02:00
|
|
|
anchors.margins: 15
|
2013-12-28 02:19:16 +01:00
|
|
|
|
2014-04-03 15:06:16 +02:00
|
|
|
ColumnLayout{
|
2013-12-28 02:19:16 +01:00
|
|
|
anchors.fill: parent
|
2014-04-03 15:06:16 +02:00
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Rasterization")
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
ColumnLayout{
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
RowLayout{
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
ExclusiveGroup { id: rasterizationgroup }
|
|
|
|
RadioButton {
|
|
|
|
text: qsTr("No Rasterization")
|
|
|
|
exclusiveGroup: rasterizationgroup
|
|
|
|
checked: shadersettings.rasterization === shadersettings.no_rasterization
|
|
|
|
onCheckedChanged: if(checked)
|
|
|
|
shadersettings.rasterization = shadersettings.no_rasterization
|
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
text: qsTr("Scanlines")
|
|
|
|
exclusiveGroup: rasterizationgroup
|
|
|
|
checked: shadersettings.rasterization === shadersettings.scanline_rasterization
|
|
|
|
onCheckedChanged: if(checked)
|
|
|
|
shadersettings.rasterization = shadersettings.scanline_rasterization
|
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
text: qsTr("Pixels")
|
|
|
|
exclusiveGroup: rasterizationgroup
|
|
|
|
checked: shadersettings.rasterization === shadersettings.pixel_rasterization
|
|
|
|
onCheckedChanged: if(checked)
|
|
|
|
shadersettings.rasterization = shadersettings.pixel_rasterization
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SimpleSlider{
|
|
|
|
Layout.fillWidth: true
|
|
|
|
value: shadersettings.rasterization_strength
|
|
|
|
onValueChanged: shadersettings.rasterization_strength = value
|
|
|
|
}
|
2013-12-25 21:04:10 +01:00
|
|
|
}
|
2014-04-03 15:06:16 +02:00
|
|
|
}
|
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Effects")
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
ColumnLayout{
|
|
|
|
anchors.fill: parent
|
|
|
|
SettingComponent{
|
|
|
|
name: "Bloom"
|
|
|
|
onValueChanged: shadersettings.bloom_strength = value
|
|
|
|
_value: shadersettings.bloom_strength
|
|
|
|
}
|
|
|
|
SettingComponent{
|
|
|
|
name: "Motion Blur"
|
|
|
|
onValueChanged: shadersettings.motion_blur = value
|
|
|
|
_value: shadersettings.motion_blur
|
|
|
|
}
|
|
|
|
SettingComponent{
|
|
|
|
name: "Noise"
|
|
|
|
onValueChanged: shadersettings.noise_strength = value
|
|
|
|
_value: shadersettings.noise_strength
|
|
|
|
}
|
|
|
|
SettingComponent{
|
|
|
|
name: "Glow"
|
|
|
|
onValueChanged: shadersettings.glowing_line_strength = value;
|
|
|
|
_value: shadersettings.glowing_line_strength
|
|
|
|
}
|
|
|
|
SettingComponent{
|
|
|
|
name: "Ambient light"
|
|
|
|
onValueChanged: shadersettings.ambient_light = value;
|
|
|
|
_value: shadersettings.ambient_light
|
|
|
|
}
|
|
|
|
SettingComponent{
|
|
|
|
name: "Screen distortion"
|
|
|
|
onValueChanged: shadersettings.screen_distortion = value;
|
|
|
|
_value: shadersettings.screen_distortion;
|
|
|
|
}
|
|
|
|
SettingComponent{
|
|
|
|
name: "Brightness flickering"
|
|
|
|
onValueChanged: shadersettings.brightness_flickering= value;
|
|
|
|
_value: shadersettings.brightness_flickering;
|
|
|
|
}
|
|
|
|
SettingComponent{
|
|
|
|
name: "Horizontal flickering"
|
|
|
|
onValueChanged: shadersettings.horizontal_sincronization = value;
|
|
|
|
_value: shadersettings.horizontal_sincronization;
|
|
|
|
}
|
2014-03-26 19:23:47 +01:00
|
|
|
}
|
2013-11-25 19:05:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|