2014-06-27 23:54:17 +02: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-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: {
|
|
|
|
scalingChanger.enabled = false;
|
|
|
|
shadersettings.rasterization = currentIndex
|
|
|
|
fontChanger.updateIndex();
|
|
|
|
scalingChanger.updateIndex();
|
|
|
|
scalingChanger.enabled = true;
|
|
|
|
}
|
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{
|
|
|
|
id: scalingChanger
|
|
|
|
Layout.fillWidth: true
|
|
|
|
minimumValue: 0
|
|
|
|
maximumValue: shadersettings.fontScalingList.length - 1
|
|
|
|
stepSize: 1
|
2014-06-25 14:29:10 +02:00
|
|
|
tickmarksEnabled: true
|
|
|
|
value: updateIndex()
|
2014-06-24 11:34:33 +02:00
|
|
|
onValueChanged: {
|
2014-06-25 14:29:10 +02:00
|
|
|
if(!enabled) return; //Ugly and hacky solution. Look for a better solution.
|
2014-07-14 00:53:17 +02:00
|
|
|
shadersettings.setScalingIndex(value);
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
2014-06-25 14:29:10 +02:00
|
|
|
function updateIndex(){
|
2014-07-14 00:53:17 +02:00
|
|
|
value = shadersettings.getScalingIndex();
|
2014-06-25 14:29:10 +02:00
|
|
|
}
|
2014-07-14 00:53:17 +02:00
|
|
|
Component.onCompleted: shadersettings.fontScalingChanged.connect(updateIndex);
|
2014-06-24 11:34:33 +02:00
|
|
|
}
|
|
|
|
Text{
|
|
|
|
text: shadersettings.fontScalingList[scalingChanger.value].toFixed(2)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Colors")
|
|
|
|
Layout.fillWidth: true
|
|
|
|
RowLayout{
|
|
|
|
anchors.fill: parent
|
|
|
|
ColorButton{
|
|
|
|
name: qsTr("Font")
|
|
|
|
height: 50
|
|
|
|
Layout.fillWidth: true
|
2014-07-16 00:38:16 +02:00
|
|
|
onColorSelected: shadersettings._font_color = color;
|
2014-06-24 11:34:33 +02:00
|
|
|
button_color: shadersettings._font_color
|
|
|
|
}
|
|
|
|
ColorButton{
|
|
|
|
name: qsTr("Background")
|
|
|
|
height: 50
|
|
|
|
Layout.fillWidth: true
|
2014-07-16 00:38:16 +02:00
|
|
|
onColorSelected: shadersettings._background_color = color;
|
2014-06-24 11:34:33 +02:00
|
|
|
button_color: shadersettings._background_color
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupBox{
|
|
|
|
title: qsTr("Frame")
|
|
|
|
Layout.fillWidth: true
|
|
|
|
RowLayout{
|
|
|
|
anchors.fill: parent
|
|
|
|
ComboBox{
|
|
|
|
id: framescombobox
|
|
|
|
Layout.fillWidth: true
|
|
|
|
model: shadersettings.frames_list
|
|
|
|
currentIndex: shadersettings.frames_index
|
|
|
|
onCurrentIndexChanged: shadersettings.frames_index = currentIndex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|