mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-11-04 00:52:11 +00:00 
			
		
		
		
	Improve settings layout.
This commit is contained in:
		@@ -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{
 | 
				
			||||||
@@ -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
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    // Save text even if user forgets to press enter or unfocus
 | 
					 | 
				
			||||||
                    function saveSetting() {
 | 
					 | 
				
			||||||
                        appSettings.customCommand = text;
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                    Component.onCompleted: settings_window.closing.connect(saveSetting)
 | 
					                Label{ text: qsTr("Opacity") }
 | 
				
			||||||
 | 
					                SimpleSlider{
 | 
				
			||||||
 | 
					                    onValueChanged: appSettings.windowOpacity = value
 | 
				
			||||||
 | 
					                    value: appSettings.windowOpacity
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -54,9 +54,9 @@ Window {
 | 
				
			|||||||
            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
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user