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{
|
2014-12-26 17:19:34 +01:00
|
|
|
property var rasterization: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")][appSettings.rasterization]
|
|
|
|
title: qsTr("Font" + "(" + rasterization + ")")
|
2014-12-26 17:51:10 +01:00
|
|
|
anchors { left: parent.left; right: parent.right }
|
2014-06-24 11:34:33 +02:00
|
|
|
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
|
2014-12-11 12:08:15 +01:00
|
|
|
model: appSettings.fontlist
|
2014-06-25 14:29:10 +02:00
|
|
|
onActivated: {
|
2014-12-16 01:22:46 +01:00
|
|
|
var name = appSettings.fontlist.get(index).name;
|
|
|
|
appSettings.fontNames[appSettings.rasterization] = name;
|
2014-12-11 12:08:15 +01:00
|
|
|
appSettings.handleFontChanged();
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
2014-06-25 14:29:10 +02:00
|
|
|
function updateIndex(){
|
2014-12-16 01:22:46 +01:00
|
|
|
var name = appSettings.fontNames[appSettings.rasterization];
|
|
|
|
var index = appSettings.getIndexByName(name);
|
|
|
|
if (index !== undefined)
|
|
|
|
currentIndex = index;
|
2014-06-25 14:29:10 +02:00
|
|
|
}
|
2014-12-16 01:22:46 +01:00
|
|
|
Connections{
|
|
|
|
target: appSettings
|
2014-12-24 15:41:08 +01:00
|
|
|
onTerminalFontChanged: fontChanger.updateIndex();
|
2014-12-16 01:22:46 +01:00
|
|
|
}
|
|
|
|
Component.onCompleted: updateIndex();
|
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
|
2014-12-11 12:08:15 +01:00
|
|
|
onValueChanged: if(enabled) appSettings.fontScaling = value
|
2014-09-29 22:38:33 +02:00
|
|
|
stepSize: 0.05
|
|
|
|
enabled: false // Another trick to fix initial bad behavior.
|
|
|
|
Component.onCompleted: {
|
|
|
|
minimumValue = 0.5;
|
|
|
|
maximumValue = 2.5;
|
2014-12-11 12:08:15 +01:00
|
|
|
value = appSettings.fontScaling;
|
2014-09-29 22:38:33 +02:00
|
|
|
enabled = true;
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
2014-09-29 22:38:33 +02:00
|
|
|
Connections{
|
2014-12-11 12:08:15 +01:00
|
|
|
target: appSettings
|
|
|
|
onFontScalingChanged: fontScalingChanger.value = appSettings.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
|
2014-12-11 12:08:15 +01:00
|
|
|
onValueChanged: appSettings.fontWidth = value;
|
|
|
|
value: appSettings.fontWidth
|
2014-09-28 18:23:14 +02:00
|
|
|
stepSize: 0.05
|
2014-12-12 01:38:32 +01:00
|
|
|
Component.onCompleted: {
|
|
|
|
// This is needed to avoid unnecessary chnaged events.
|
|
|
|
minimumValue = 0.5;
|
|
|
|
maximumValue = 1.5;
|
|
|
|
}
|
2014-09-28 18:23:14 +02:00
|
|
|
}
|
|
|
|
Text{
|
|
|
|
text: Math.round(widthChanger.value * 100) + "%"
|
|
|
|
}
|
|
|
|
}
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Colors")
|
2014-12-26 17:51:10 +01:00
|
|
|
anchors { left: parent.left; right: parent.right }
|
2014-08-01 00:04:59 +02:00
|
|
|
ColumnLayout{
|
2014-08-02 20:03:16 +02:00
|
|
|
anchors.fill: parent
|
2014-12-26 17:51:10 +01:00
|
|
|
ColumnLayout{
|
|
|
|
Layout.fillWidth: true
|
|
|
|
CheckableSlider{
|
|
|
|
name: qsTr("Chroma Color")
|
|
|
|
onNewValue: appSettings.chromaColor = newValue
|
|
|
|
value: appSettings.chromaColor
|
|
|
|
}
|
|
|
|
CheckableSlider{
|
|
|
|
name: qsTr("Saturation Color")
|
|
|
|
onNewValue: appSettings.saturationColor = newValue
|
|
|
|
value: appSettings.saturationColor
|
|
|
|
enabled: appSettings.chromaColor !== 0
|
|
|
|
}
|
|
|
|
}
|
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
|
2014-12-23 18:13:34 +01:00
|
|
|
onColorSelected: appSettings._fontColor = color;
|
|
|
|
button_color: appSettings._fontColor
|
2014-08-01 00:04:59 +02:00
|
|
|
}
|
|
|
|
ColorButton{
|
|
|
|
name: qsTr("Background")
|
|
|
|
height: 50
|
|
|
|
Layout.fillWidth: true
|
2014-12-23 18:13:34 +01:00
|
|
|
onColorSelected: appSettings._backgroundColor = color;
|
|
|
|
button_color: appSettings._backgroundColor
|
2014-08-01 00:04:59 +02:00
|
|
|
}
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|