1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2024-10-06 11:00:49 +01:00
cool-retro-term/app/qml/SettingsTerminalTab.qml

144 lines
5.8 KiB
QML
Raw Normal View History

2014-06-27 22:54:17 +01:00
/*******************************************************************************
* Copyright (c) 2013 "Filippo Scognamiglio"
* https://github.com/Swordfish90/cool-retro-term
2014-06-27 22:54:17 +01:00
*
* This file is part of cool-retro-term.
2014-06-27 22:54:17 +01:00
*
* cool-retro-term is free software: you can redistribute it and/or modify
2014-06-27 22:54:17 +01: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/>.
*******************************************************************************/
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 13:29:10 +01:00
property string selectedElement: model[currentIndex]
anchors.fill: parent
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
currentIndex: shadersettings.rasterization
2014-06-25 13:29:10 +01:00
onCurrentIndexChanged: {
shadersettings.rasterization = currentIndex
fontChanger.updateIndex();
}
}
}
GroupBox{
2014-06-25 13:29:10 +01:00
title: qsTr("Font") + " (" + rasterizationBox.selectedElement + ")"
Layout.fillWidth: true
GridLayout{
anchors.fill: parent
columns: 2
Text{ text: qsTr("Name") }
ComboBox{
2014-06-25 13:29:10 +01:00
id: fontChanger
Layout.fillWidth: true
model: shadersettings.fontlist
2014-06-25 13:29:10 +01:00
currentIndex: updateIndex()
onActivated: {
shadersettings.fontIndexes[shadersettings.rasterization] = index;
shadersettings.handleFontChanged();
}
2014-06-25 13:29:10 +01:00
function updateIndex(){
currentIndex = shadersettings.fontIndexes[shadersettings.rasterization];
}
}
Text{ text: qsTr("Scaling") }
RowLayout{
Layout.fillWidth: true
Slider{
Layout.fillWidth: true
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;
}
Connections{
target: shadersettings
onFontScalingChanged: fontScalingChanger.value = shadersettings.fontScaling;
2014-06-25 13:29:10 +01:00
}
}
Text{
text: Math.round(fontScalingChanger.value * 100) + "%"
}
}
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) + "%"
}
}
}
}
GroupBox{
title: qsTr("Colors")
Layout.fillWidth: true
2014-07-31 23:04:59 +01:00
ColumnLayout{
2014-08-02 19:03:16 +01:00
anchors.fill: parent
2014-07-31 23:04:59 +01:00
RowLayout{
2014-08-02 19:03:16 +01:00
Layout.fillWidth: true
2014-07-31 23:04:59 +01: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-07-31 23:04:59 +01:00
ColumnLayout{
2014-08-02 19:03:16 +01:00
Layout.fillWidth: true
2014-07-31 23:04:59 +01:00
CheckableSlider{
name: qsTr("Chroma Color")
onNewValue: shadersettings.chroma_color = newValue
value: shadersettings.chroma_color
2014-07-31 23:04:59 +01:00
}
CheckableSlider{
name: qsTr("Saturation Color")
onNewValue: shadersettings.saturation_color = newValue
value: shadersettings.saturation_color
enabled: shadersettings.chroma_color !== 0
2014-07-31 23:04:59 +01:00
}
}
}
}
}
}