2014-06-27 23:54:17 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2013 "Filippo Scognamiglio"
|
2014-09-03 22:19:34 +02:00
|
|
|
* https://github.com/Swordfish90/cool-retro-term
|
2014-06-27 23:54:17 +02:00
|
|
|
*
|
2014-09-03 22:19:34 +02:00
|
|
|
* This file is part of cool-retro-term.
|
2014-06-27 23:54:17 +02:00
|
|
|
*
|
2014-09-03 22:19:34 +02:00
|
|
|
* cool-retro-term is free software: you can redistribute it and/or modify
|
2014-06-27 23:54:17 +02:00
|
|
|
* 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-06-24 11:34:33 +02:00
|
|
|
import QtQuick 2.2
|
|
|
|
import QtQuick.Controls 1.1
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
|
|
|
|
Tab{
|
|
|
|
ColumnLayout{
|
|
|
|
anchors.fill: parent
|
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Rasterization Mode")
|
|
|
|
Layout.fillWidth: true
|
|
|
|
ComboBox {
|
|
|
|
id: rasterizationBox
|
2014-06-25 14:29:10 +02:00
|
|
|
property string selectedElement: model[currentIndex]
|
2014-06-24 11:34:33 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
|
|
|
|
currentIndex: shadersettings.rasterization
|
2014-06-25 14:29:10 +02:00
|
|
|
onCurrentIndexChanged: {
|
|
|
|
shadersettings.rasterization = currentIndex
|
|
|
|
fontChanger.updateIndex();
|
|
|
|
}
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupBox{
|
2014-06-25 14:29:10 +02:00
|
|
|
title: qsTr("Font") + " (" + rasterizationBox.selectedElement + ")"
|
2014-06-24 11:34:33 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
GridLayout{
|
|
|
|
anchors.fill: parent
|
|
|
|
columns: 2
|
|
|
|
Text{ text: qsTr("Name") }
|
|
|
|
ComboBox{
|
2014-06-25 14:29:10 +02:00
|
|
|
id: fontChanger
|
2014-06-24 11:34:33 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
model: shadersettings.fontlist
|
2014-06-25 14:29:10 +02:00
|
|
|
currentIndex: updateIndex()
|
|
|
|
onActivated: {
|
|
|
|
shadersettings.fontIndexes[shadersettings.rasterization] = index;
|
2014-06-24 11:34:33 +02:00
|
|
|
shadersettings.handleFontChanged();
|
|
|
|
}
|
2014-06-25 14:29:10 +02:00
|
|
|
function updateIndex(){
|
|
|
|
currentIndex = shadersettings.fontIndexes[shadersettings.rasterization];
|
|
|
|
}
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
Text{ text: qsTr("Scaling") }
|
|
|
|
RowLayout{
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Slider{
|
|
|
|
Layout.fillWidth: true
|
2014-09-29 22:38:33 +02:00
|
|
|
id: fontScalingChanger
|
|
|
|
onValueChanged: if(enabled) shadersettings.fontScaling = value
|
|
|
|
stepSize: 0.05
|
|
|
|
enabled: false // Another trick to fix initial bad behavior.
|
|
|
|
Component.onCompleted: {
|
|
|
|
minimumValue = 0.5;
|
|
|
|
maximumValue = 2.5;
|
|
|
|
value = shadersettings.fontScaling;
|
|
|
|
enabled = true;
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
2014-09-29 22:38:33 +02:00
|
|
|
Connections{
|
|
|
|
target: shadersettings
|
|
|
|
onFontScalingChanged: fontScalingChanger.value = shadersettings.fontScaling;
|
2014-06-25 14:29:10 +02:00
|
|
|
}
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
Text{
|
2014-09-29 22:38:33 +02:00
|
|
|
text: Math.round(fontScalingChanger.value * 100) + "%"
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
}
|
2014-09-28 18:23:14 +02:00
|
|
|
Text{ text: qsTr("Font Width") }
|
|
|
|
RowLayout{
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Slider{
|
|
|
|
Layout.fillWidth: true
|
|
|
|
id: widthChanger
|
|
|
|
onValueChanged: shadersettings.fontWidth = value;
|
|
|
|
value: shadersettings.fontWidth
|
|
|
|
stepSize: 0.05
|
|
|
|
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
|
|
|
|
}
|
|
|
|
Text{
|
|
|
|
text: Math.round(widthChanger.value * 100) + "%"
|
|
|
|
}
|
|
|
|
}
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Colors")
|
|
|
|
Layout.fillWidth: true
|
2014-08-01 00:04:59 +02:00
|
|
|
ColumnLayout{
|
2014-08-02 20:03:16 +02:00
|
|
|
anchors.fill: parent
|
2014-08-01 00:04:59 +02:00
|
|
|
RowLayout{
|
2014-08-02 20:03:16 +02:00
|
|
|
Layout.fillWidth: true
|
2014-08-01 00:04:59 +02:00
|
|
|
ColorButton{
|
|
|
|
name: qsTr("Font")
|
|
|
|
height: 50
|
|
|
|
Layout.fillWidth: true
|
|
|
|
onColorSelected: shadersettings._font_color = color;
|
|
|
|
button_color: shadersettings._font_color
|
|
|
|
}
|
|
|
|
ColorButton{
|
|
|
|
name: qsTr("Background")
|
|
|
|
height: 50
|
|
|
|
Layout.fillWidth: true
|
|
|
|
onColorSelected: shadersettings._background_color = color;
|
|
|
|
button_color: shadersettings._background_color
|
|
|
|
}
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
2014-08-01 00:04:59 +02:00
|
|
|
ColumnLayout{
|
2014-08-02 20:03:16 +02:00
|
|
|
Layout.fillWidth: true
|
2014-08-01 00:04:59 +02:00
|
|
|
CheckableSlider{
|
|
|
|
name: qsTr("Chroma Color")
|
2014-08-09 14:45:01 +02:00
|
|
|
onNewValue: shadersettings.chroma_color = newValue
|
|
|
|
value: shadersettings.chroma_color
|
2014-08-01 00:04:59 +02:00
|
|
|
}
|
|
|
|
CheckableSlider{
|
|
|
|
name: qsTr("Saturation Color")
|
2014-08-09 14:45:01 +02:00
|
|
|
onNewValue: shadersettings.saturation_color = newValue
|
|
|
|
value: shadersettings.saturation_color
|
|
|
|
enabled: shadersettings.chroma_color !== 0
|
2014-08-01 00:04:59 +02:00
|
|
|
}
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|