1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-01-18 20:20:45 +00:00

Improve settings layout.

This commit is contained in:
Filippo Scognamiglio 2018-12-16 23:46:05 +01:00
parent 0d3c0a2233
commit 767a61b86e
5 changed files with 66 additions and 78 deletions

View File

@ -27,13 +27,48 @@ import "Components"
Tab{ Tab{
ColumnLayout{ ColumnLayout{
anchors.fill: parent anchors.fill: parent
GroupBox{ GroupBox{
title: qsTr("General") Layout.fillWidth: true
title: qsTr("Command")
ColumnLayout {
anchors.fill: parent
CheckBox{
id: useCustomCommand
text: qsTr("Use custom command instead of shell at startup")
checked: appSettings.useCustomCommand
onCheckedChanged: appSettings.useCustomCommand = checked
}
// Workaround for QTBUG-31627 for pre 5.3.0
Binding{
target: useCustomCommand
property: "checked"
value: appSettings.useCustomCommand
}
TextField{
id: customCommand
Layout.fillWidth: true
text: appSettings.customCommand
enabled: useCustomCommand.checked
onEditingFinished: appSettings.customCommand = text
// Save text even if user forgets to press enter or unfocus
function saveSetting() {
appSettings.customCommand = text;
}
Component.onCompleted: settings_window.closing.connect(saveSetting)
}
}
}
GroupBox{
title: qsTr("Performance")
Layout.fillWidth: true Layout.fillWidth: true
GridLayout{ GridLayout{
anchors.fill: parent anchors.fill: parent
rows: 2 rows: 2
columns: 3 columns: 3
Label{text: qsTr("Effects FPS")} Label{text: qsTr("Effects FPS")}
Slider{ Slider{
Layout.fillWidth: true Layout.fillWidth: true
@ -52,6 +87,7 @@ Tab{
enabled = true; enabled = true;
} }
} }
SizedLabel{text: appSettings.fps !== 0 ? appSettings.fps : qsTr("Max")} SizedLabel{text: appSettings.fps !== 0 ? appSettings.fps : qsTr("Max")}
Label{text: qsTr("Texture Quality")} Label{text: qsTr("Texture Quality")}
Slider{ Slider{
@ -67,14 +103,7 @@ Tab{
} }
} }
SizedLabel{text: Math.round(txtslider.value * 100) + "%"} SizedLabel{text: Math.round(txtslider.value * 100) + "%"}
}
}
GroupBox{
title: qsTr("Bloom")
Layout.fillWidth: true
GridLayout{
id: bloomQualityContainer
anchors.fill: parent
Label{text: qsTr("Bloom Quality")} Label{text: qsTr("Bloom Quality")}
Slider{ Slider{
Layout.fillWidth: true Layout.fillWidth: true
@ -89,14 +118,6 @@ Tab{
} }
} }
SizedLabel{text: Math.round(bloomSlider.value * 100) + "%"} SizedLabel{text: Math.round(bloomSlider.value * 100) + "%"}
}
}
GroupBox{
title: qsTr("BurnIn")
Layout.fillWidth: true
GridLayout{
id: blurQualityContainer
anchors.fill: parent
Label{text: qsTr("BurnIn Quality")} Label{text: qsTr("BurnIn Quality")}
Slider{ Slider{

View File

@ -87,34 +87,5 @@ Tab{
} }
} }
} }
GroupBox{
title: qsTr("Lights")
Layout.fillWidth: true
GridLayout{
anchors.fill: parent
columns: 2
Label{ text: qsTr("Brightness") }
SimpleSlider{
onValueChanged: appSettings.brightness = value
value: appSettings.brightness
}
Label{ text: qsTr("Contrast") }
SimpleSlider{
onValueChanged: appSettings.contrast = value
value: appSettings.contrast
}
Label{ text: qsTr("Opacity") }
SimpleSlider{
onValueChanged: appSettings.windowOpacity = value
value: appSettings.windowOpacity
}
Label{ text: qsTr("Margin") }
SimpleSlider{
onValueChanged: appSettings._margin = value
value: appSettings._margin
}
}
}
} }
} }

View File

@ -52,7 +52,7 @@ Tab{
Layout.fillWidth: false Layout.fillWidth: false
Button{ Button{
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("New") text: qsTr("Save")
onClicked: { onClicked: {
insertname.profileName = ""; insertname.profileName = "";
insertname.show() insertname.show()
@ -164,34 +164,30 @@ Tab{
} }
GroupBox{ GroupBox{
title: qsTr("Screen")
Layout.fillWidth: true Layout.fillWidth: true
title: qsTr("Command") GridLayout{
ColumnLayout {
anchors.fill: parent anchors.fill: parent
CheckBox{ columns: 2
id: useCustomCommand Label{ text: qsTr("Brightness") }
text: qsTr("Use custom command instead of shell at startup") SimpleSlider{
checked: appSettings.useCustomCommand onValueChanged: appSettings.brightness = value
onCheckedChanged: appSettings.useCustomCommand = checked value: appSettings.brightness
} }
// Workaround for QTBUG-31627 for pre 5.3.0 Label{ text: qsTr("Contrast") }
Binding{ SimpleSlider{
target: useCustomCommand onValueChanged: appSettings.contrast = value
property: "checked" value: appSettings.contrast
value: appSettings.useCustomCommand
} }
TextField{ Label{ text: qsTr("Margin") }
id: customCommand SimpleSlider{
Layout.fillWidth: true onValueChanged: appSettings._margin = value
text: appSettings.customCommand value: appSettings._margin
enabled: useCustomCommand.checked }
onEditingFinished: appSettings.customCommand = text Label{ text: qsTr("Opacity") }
SimpleSlider{
// Save text even if user forgets to press enter or unfocus onValueChanged: appSettings.windowOpacity = value
function saveSetting() { value: appSettings.windowOpacity
appSettings.customCommand = text;
}
Component.onCompleted: settings_window.closing.connect(saveSetting)
} }
} }
} }

View File

@ -28,7 +28,7 @@ Window {
id: settings_window id: settings_window
title: qsTr("Settings") title: qsTr("Settings")
width: 580 width: 580
height: 500 height: 400
property int tabmargins: 15 property int tabmargins: 15
@ -36,27 +36,27 @@ Window {
id: tabView id: tabView
anchors.fill: parent anchors.fill: parent
anchors.margins: 10 anchors.margins: 10
SettingsGeneralTab{ SettingsGeneralTab {
id: generalTab id: generalTab
title: qsTr("General") title: qsTr("General")
anchors.fill: parent anchors.fill: parent
anchors.margins: tabmargins anchors.margins: tabmargins
} }
SettingsTerminalTab{ SettingsTerminalTab {
id: terminalTab id: terminalTab
title: qsTr("Terminal") title: qsTr("Terminal")
anchors.fill: parent anchors.fill: parent
anchors.margins: tabmargins anchors.margins: tabmargins
} }
SettingsEffectsTab{ SettingsEffectsTab {
id: effectsTab id: effectsTab
title: qsTr("Effects") title: qsTr("Effects")
anchors.fill: parent anchors.fill: parent
anchors.margins: tabmargins anchors.margins: tabmargins
} }
SettingsPerformanceTab{ SettingsAdvancedTab {
id: performanceTab id: performanceTab
title: qsTr("Performance") title: qsTr("Advanced")
anchors.fill: parent anchors.fill: parent
anchors.margins: tabmargins anchors.margins: tabmargins
} }

View File

@ -23,7 +23,7 @@
<file>fonts/1971-ibm-3278/3270Medium.ttf</file> <file>fonts/1971-ibm-3278/3270Medium.ttf</file>
<file>Storage.qml</file> <file>Storage.qml</file>
<file>CRTMainMenuBar.qml</file> <file>CRTMainMenuBar.qml</file>
<file>SettingsPerformanceTab.qml</file> <file>SettingsAdvancedTab.qml</file>
<file>TerminalContainer.qml</file> <file>TerminalContainer.qml</file>
<file>images/crt256.png</file> <file>images/crt256.png</file>
<file>utils.js</file> <file>utils.js</file>