1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-01-31 02:01:19 +00:00

Reorganize settings window.

This commit is contained in:
Filippo Scognamiglio 2014-09-29 02:00:54 +02:00
parent d885f27e0b
commit 1dd633be0b
5 changed files with 101 additions and 54 deletions

View File

@ -92,49 +92,17 @@ Tab{
}
}
GroupBox{
title: qsTr("Performace")
title: qsTr("Frame")
Layout.fillWidth: true
Layout.columnSpan: 2
anchors.left: parent.left
anchors.right: parent.right
GridLayout{
RowLayout{
anchors.fill: parent
rows: 3
columns: 3
CheckBox{
Layout.columnSpan: 3
checked: !shadersettings._frameReflections
text: qsTr("Disable reflections")
onCheckedChanged: shadersettings._frameReflections = !checked
enabled: shadersettings.reflectionsAllowed
}
CheckBox{
property int fps: checked ? slider.value : 0
onFpsChanged: shadersettings.fps = fps
checked: shadersettings.fps !== 0
text: qsTr("Limit FPS")
}
Slider{
id: slider
ComboBox{
id: framescombobox
Layout.fillWidth: true
stepSize: 1
maximumValue: 60
minimumValue: 1
enabled: shadersettings.fps !== 0
value: shadersettings.fps !== 0 ? shadersettings.fps : 60
model: shadersettings.frames_list
currentIndex: shadersettings.frames_index
onCurrentIndexChanged: shadersettings.frames_index = currentIndex
}
Text{text: slider.value}
Text{text: qsTr("Texture quality")}
Slider{
Layout.fillWidth: true
id: txtslider
onValueChanged: shadersettings.window_scaling = value;
value: shadersettings.window_scaling
tickmarksEnabled: true
stepSize: 0.25
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
}
Text{text: Math.round(txtslider.value * 100) + "%"}
}
}
}

View File

@ -0,0 +1,82 @@
/*******************************************************************************
* Copyright (c) 2013 "Filippo Scognamiglio"
* https://github.com/Swordfish90/cool-retro-term
*
* This file is part of cool-retro-term.
*
* cool-retro-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/>.
*******************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
Tab{
ColumnLayout{
anchors.fill: parent
GroupBox{
title: qsTr("General")
Layout.fillWidth: true
Layout.columnSpan: 2
anchors.left: parent.left
anchors.right: parent.right
GridLayout{
anchors.fill: parent
rows: 2
columns: 3
CheckBox{
property int fps: checked ? slider.value : 0
onFpsChanged: shadersettings.fps = fps
checked: shadersettings.fps !== 0
text: qsTr("Limit FPS")
}
Slider{
id: slider
Layout.fillWidth: true
stepSize: 1
maximumValue: 60
minimumValue: 1
enabled: shadersettings.fps !== 0
value: shadersettings.fps !== 0 ? shadersettings.fps : 60
}
Text{text: slider.value}
Text{text: qsTr("Texture quality")}
Slider{
Layout.fillWidth: true
id: txtslider
onValueChanged: shadersettings.window_scaling = value;
value: shadersettings.window_scaling
tickmarksEnabled: true
stepSize: 0.25
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
}
Text{text: Math.round(txtslider.value * 100) + "%"}
}
}
GroupBox{
title: qsTr("Frame")
Layout.fillWidth: true
Layout.columnSpan: 2
anchors.left: parent.left
anchors.right: parent.right
CheckBox{
Layout.columnSpan: 3
checked: !shadersettings._frameReflections
text: qsTr("Disable reflections")
onCheckedChanged: shadersettings._frameReflections = !checked
enabled: shadersettings.reflectionsAllowed
}
}
}
}

View File

@ -142,19 +142,5 @@ Tab{
}
}
}
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
}
}
}
}
}

View File

@ -28,27 +28,37 @@ Window {
id: settings_window
title: qsTr("Settings")
width: 640
height: 480
height: 440
property int tabmargins: 15
TabView{
id: tabView
anchors.fill: parent
anchors.margins: 10
SettingsGeneralTab{
id: generalTab
title: qsTr("General")
anchors.fill: parent
anchors.margins: tabmargins
}
SettingsTerminalTab{
id: terminalTab
title: qsTr("Terminal")
anchors.fill: parent
anchors.margins: tabmargins
}
SettingsEffectsTab{
id: effectsTab
title: qsTr("Effects")
anchors.fill: parent
anchors.margins: tabmargins
}
SettingsPerformanceTab{
id: performanceTab
title: qsTr("Performance")
anchors.fill: parent
anchors.margins: tabmargins
}
}
}

View File

@ -64,5 +64,6 @@
<file>fonts/1985-ibm-pc-vga/dos437.txt</file>
<file>Storage.qml</file>
<file>CRTMainMenuBar.qml</file>
<file>SettingsPerformanceTab.qml</file>
</qresource>
</RCC>