mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-25 22:38:52 +00:00
Redisigned and refactored settings window.
This commit is contained in:
parent
1693e51d89
commit
b0aad13ba7
@ -56,6 +56,14 @@ RowLayout {
|
|||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
id: textfield
|
id: textfield
|
||||||
text: Math.round(((value - min_value) / (max_value - min_value)) * 100) + "%"
|
property string unformattedText: Math.round(((value - min_value) / (max_value - min_value)) * 100)
|
||||||
|
text: formatNumber(unformattedText)
|
||||||
|
}
|
||||||
|
function formatNumber(num) {
|
||||||
|
var n = "" + num;
|
||||||
|
while (n.length < 3) {
|
||||||
|
n = " " + n;
|
||||||
|
}
|
||||||
|
return n + "%";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,7 +22,8 @@ import QtQuick 2.2
|
|||||||
import QtQuick.Dialogs 1.1
|
import QtQuick.Dialogs 1.1
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property color button_color;
|
property color button_color
|
||||||
|
property string name
|
||||||
|
|
||||||
ColorDialog {
|
ColorDialog {
|
||||||
id: colorDialog
|
id: colorDialog
|
||||||
@ -35,25 +36,22 @@ Item {
|
|||||||
onAccepted: button_color = color;
|
onAccepted: button_color = color;
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
radius: 10
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
radius: 10
|
||||||
color: button_color
|
color: button_color
|
||||||
|
border.color: "black"
|
||||||
Text{
|
Glossy {}
|
||||||
id: text_color
|
Rectangle {
|
||||||
anchors.centerIn: parent
|
anchors.fill: parent
|
||||||
z: 1.1
|
anchors.margins: parent.height * 0.25
|
||||||
text: button_color
|
radius: parent.radius
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: text_color.width * 1.4
|
|
||||||
height: text_color.height * 1.4
|
|
||||||
radius: 10
|
|
||||||
border.color: "black"
|
|
||||||
border.width: 2
|
|
||||||
color: "white"
|
color: "white"
|
||||||
|
opacity: 0.5
|
||||||
|
}
|
||||||
|
Text{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
z: parent.z + 1
|
||||||
|
text: name + ": " + button_color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
21
app/Glossy.qml
Normal file
21
app/Glossy.qml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import QtQuick 2.2
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width - parent.border.width
|
||||||
|
height: parent.height - parent.border.width
|
||||||
|
radius:parent.radius - parent.border.width/2
|
||||||
|
smooth: true
|
||||||
|
|
||||||
|
border.width: parent.border.width/2
|
||||||
|
border.color: "#22FFFFFF"
|
||||||
|
|
||||||
|
gradient: Gradient {
|
||||||
|
GradientStop { position: 0; color: "#88FFFFFF" }
|
||||||
|
GradientStop { position: .1; color: "#55FFFFFF" }
|
||||||
|
GradientStop { position: .5; color: "#33FFFFFF" }
|
||||||
|
GradientStop { position: .501; color: "#11000000" }
|
||||||
|
GradientStop { position: .8; color: "#11FFFFFF" }
|
||||||
|
GradientStop { position: 1; color: "#55FFFFFF" }
|
||||||
|
}
|
||||||
|
}
|
53
app/SettingsEffectsTab.qml
Normal file
53
app/SettingsEffectsTab.qml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Controls 1.1
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
|
Tab{
|
||||||
|
GroupBox{
|
||||||
|
title: qsTr("Effects")
|
||||||
|
anchors.fill: parent
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
CheckableSlider{
|
||||||
|
name: qsTr("Bloom")
|
||||||
|
onValueChanged: shadersettings.bloom_strength = value
|
||||||
|
_value: shadersettings.bloom_strength
|
||||||
|
}
|
||||||
|
CheckableSlider{
|
||||||
|
name: qsTr("Motion Blur")
|
||||||
|
onValueChanged: shadersettings.motion_blur = value
|
||||||
|
_value: shadersettings.motion_blur
|
||||||
|
}
|
||||||
|
CheckableSlider{
|
||||||
|
name: qsTr("Noise")
|
||||||
|
onValueChanged: shadersettings.noise_strength = value
|
||||||
|
_value: shadersettings.noise_strength
|
||||||
|
}
|
||||||
|
CheckableSlider{
|
||||||
|
name: qsTr("Jitter")
|
||||||
|
onValueChanged: shadersettings.jitter = value
|
||||||
|
_value: shadersettings.jitter
|
||||||
|
}
|
||||||
|
CheckableSlider{
|
||||||
|
name: qsTr("Glow")
|
||||||
|
onValueChanged: shadersettings.glowing_line_strength = value;
|
||||||
|
_value: shadersettings.glowing_line_strength
|
||||||
|
}
|
||||||
|
CheckableSlider{
|
||||||
|
name: qsTr("Screen distortion")
|
||||||
|
onValueChanged: shadersettings.screen_distortion = value;
|
||||||
|
_value: shadersettings.screen_distortion;
|
||||||
|
}
|
||||||
|
CheckableSlider{
|
||||||
|
name: qsTr("Brightness flickering")
|
||||||
|
onValueChanged: shadersettings.brightness_flickering= value;
|
||||||
|
_value: shadersettings.brightness_flickering;
|
||||||
|
}
|
||||||
|
CheckableSlider{
|
||||||
|
name: qsTr("Horizontal flickering")
|
||||||
|
onValueChanged: shadersettings.horizontal_sincronization = value;
|
||||||
|
_value: shadersettings.horizontal_sincronization;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
109
app/SettingsGeneralTab.qml
Normal file
109
app/SettingsGeneralTab.qml
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Controls 1.1
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
|
Tab{
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
GroupBox{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
title: qsTr("Profile")
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
ComboBox{
|
||||||
|
id: profilesbox
|
||||||
|
Layout.fillWidth: true
|
||||||
|
model: shadersettings.profiles_list
|
||||||
|
currentIndex: shadersettings.profiles_index
|
||||||
|
}
|
||||||
|
RowLayout{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Button{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Load")
|
||||||
|
onClicked: {
|
||||||
|
shadersettings.profiles_index = profilesbox.currentIndex
|
||||||
|
shadersettings.loadCurrentProfile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Button{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Store current")
|
||||||
|
onClicked: insertname.show()
|
||||||
|
}
|
||||||
|
Button{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Remove Selected")
|
||||||
|
enabled: !shadersettings.profiles_list.get(profilesbox.currentIndex).builtin
|
||||||
|
onClicked: {
|
||||||
|
shadersettings.profiles_list.remove(profilesbox.currentIndex)
|
||||||
|
profilesbox.currentIndex = profilesbox.currentIndex - 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
InsertNameDialog{
|
||||||
|
id: insertname
|
||||||
|
onNameSelected: shadersettings.addNewCustomProfile(name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupBox{
|
||||||
|
title: qsTr("Lights")
|
||||||
|
Layout.fillWidth: true
|
||||||
|
GridLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
columns: 2
|
||||||
|
Text{ text: qsTr("Brightness") }
|
||||||
|
SimpleSlider{
|
||||||
|
onValueChanged: shadersettings.brightness = value
|
||||||
|
value: shadersettings.brightness
|
||||||
|
}
|
||||||
|
Text{ text: qsTr("Contrast") }
|
||||||
|
SimpleSlider{
|
||||||
|
onValueChanged: shadersettings.contrast = value
|
||||||
|
value: shadersettings.contrast
|
||||||
|
}
|
||||||
|
Text{ text: qsTr("Ambient") }
|
||||||
|
SimpleSlider{
|
||||||
|
onValueChanged: shadersettings.ambient_light = value;
|
||||||
|
value: shadersettings.ambient_light
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupBox{
|
||||||
|
title: qsTr("Performace")
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
GridLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
rows: 2
|
||||||
|
columns: 3
|
||||||
|
Text{text: qsTr("Animation FPS")}
|
||||||
|
Slider{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: slider
|
||||||
|
stepSize: 1
|
||||||
|
maximumValue: 60
|
||||||
|
minimumValue: 0
|
||||||
|
onValueChanged: shadersettings.fps = value;
|
||||||
|
value: shadersettings.fps
|
||||||
|
}
|
||||||
|
Text{text: slider.value}
|
||||||
|
Text{text: qsTr("Texture quality")}
|
||||||
|
Slider{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: txtslider
|
||||||
|
stepSize: 0.01
|
||||||
|
maximumValue: 1
|
||||||
|
minimumValue: 0
|
||||||
|
onValueChanged: shadersettings.window_scaling = value;
|
||||||
|
value: shadersettings.window_scaling
|
||||||
|
updateValueWhileDragging: false
|
||||||
|
}
|
||||||
|
Text{text: Math.round(txtslider.__handlePos * 100) + "%"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -28,281 +28,29 @@ Window {
|
|||||||
id: settings_window
|
id: settings_window
|
||||||
title: qsTr("Settings")
|
title: qsTr("Settings")
|
||||||
width: 640
|
width: 640
|
||||||
height: 480
|
height: 420
|
||||||
|
|
||||||
|
property int tabmargins: 15
|
||||||
|
|
||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
|
|
||||||
TabView{
|
TabView{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
Tab{
|
SettingsGeneralTab{
|
||||||
title: qsTr("Appearance")
|
title: qsTr("General")
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 15
|
anchors.margins: tabmargins
|
||||||
GridLayout{
|
|
||||||
anchors.fill: parent
|
|
||||||
columns: 2
|
|
||||||
GroupBox{
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
title: qsTr("Profile")
|
|
||||||
RowLayout{
|
|
||||||
anchors.fill: parent
|
|
||||||
ComboBox{
|
|
||||||
id: profilesbox
|
|
||||||
Layout.fillWidth: true
|
|
||||||
model: shadersettings.profiles_list
|
|
||||||
currentIndex: shadersettings.profiles_index
|
|
||||||
}
|
|
||||||
Button{
|
|
||||||
text: "Load"
|
|
||||||
onClicked: shadersettings.profiles_index = profilesbox.currentIndex
|
|
||||||
}
|
|
||||||
Button{
|
|
||||||
text: "Add"
|
|
||||||
onClicked: insertname.show()
|
|
||||||
}
|
|
||||||
Button{
|
|
||||||
text: "Remove"
|
|
||||||
enabled: !shadersettings.profiles_list.get(profilesbox.currentIndex).builtin
|
|
||||||
onClicked: {
|
|
||||||
shadersettings.profiles_list.remove(profilesbox.currentIndex)
|
|
||||||
profilesbox.currentIndex = profilesbox.currentIndex - 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
InsertNameDialog{
|
|
||||||
id: insertname
|
|
||||||
onNameSelected: shadersettings.addNewCustomProfile(name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupBox{
|
|
||||||
id: fontbox
|
|
||||||
title: qsTr("Font")
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
GridLayout{
|
|
||||||
anchors.fill: parent
|
|
||||||
columns: 2
|
|
||||||
Text{text: qsTr("Font style:")}
|
|
||||||
ComboBox{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
model: shadersettings.fontlist
|
|
||||||
currentIndex: shadersettings.fontIndex
|
|
||||||
onCurrentIndexChanged: shadersettings.fontIndex = currentIndex
|
|
||||||
}
|
|
||||||
Text{text: qsTr("Font scaling:")}
|
|
||||||
ComboBox{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
model: shadersettings.fontScalingList
|
|
||||||
currentIndex: shadersettings.fontScalingIndex
|
|
||||||
onCurrentIndexChanged: shadersettings.fontScalingIndex = currentIndex
|
|
||||||
}
|
|
||||||
Item{Layout.fillHeight: true}
|
|
||||||
ColorButton{
|
|
||||||
height: 50
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
onButton_colorChanged: shadersettings._font_color = button_color;
|
|
||||||
button_color: shadersettings._font_color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GroupBox{
|
|
||||||
title: qsTr("Background")
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
GridLayout{
|
|
||||||
anchors.fill: parent
|
|
||||||
columns: 2
|
|
||||||
Text{text: "Frame texture"}
|
|
||||||
ComboBox{
|
|
||||||
id: framescombobox
|
|
||||||
Layout.fillWidth: true
|
|
||||||
model: shadersettings.frames_list
|
|
||||||
currentIndex: shadersettings.frames_index
|
|
||||||
onCurrentIndexChanged: shadersettings.frames_index = currentIndex
|
|
||||||
}
|
|
||||||
CheckBox{
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
checked: shadersettings.frame_reflections
|
|
||||||
text: qsTr("Frame reflections")
|
|
||||||
onCheckedChanged: shadersettings.frame_reflections = checked
|
|
||||||
enabled: framescombobox.model.get(framescombobox.currentIndex).reflections
|
|
||||||
}
|
|
||||||
|
|
||||||
Item{Layout.fillHeight: true}
|
|
||||||
ColorButton{
|
|
||||||
height: 50
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
|
|
||||||
onButton_colorChanged: shadersettings._background_color= button_color
|
|
||||||
button_color: shadersettings._background_color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GroupBox{
|
|
||||||
title: qsTr("Lights")
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
GridLayout{
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
columns: 2
|
|
||||||
rows: 2
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
Text{text: qsTr("Contrast")}
|
|
||||||
SimpleSlider{
|
|
||||||
onValueChanged: shadersettings.contrast = value
|
|
||||||
value: shadersettings.contrast
|
|
||||||
}
|
|
||||||
Text{text: qsTr("Brightness")}
|
|
||||||
SimpleSlider{
|
|
||||||
onValueChanged: shadersettings.brightness = value
|
|
||||||
value: shadersettings.brightness
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GroupBox{
|
|
||||||
title: qsTr("Performace")
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
GridLayout{
|
|
||||||
columns: 3
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
anchors {left: parent.left; right: parent.right}
|
|
||||||
Text{text: "Animation FPS"}
|
|
||||||
Slider{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
id: slider
|
|
||||||
stepSize: 1
|
|
||||||
maximumValue: 60
|
|
||||||
minimumValue: 0
|
|
||||||
onValueChanged: shadersettings.fps = value;
|
|
||||||
value: shadersettings.fps
|
|
||||||
}
|
|
||||||
Text{text: slider.value}
|
|
||||||
Text{text: "Texture quality"}
|
|
||||||
Slider{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
id: txtslider
|
|
||||||
stepSize: 0.01
|
|
||||||
maximumValue: 1
|
|
||||||
minimumValue: 0
|
|
||||||
onValueChanged: shadersettings.window_scaling = value;
|
|
||||||
value: shadersettings.window_scaling
|
|
||||||
updateValueWhileDragging: false
|
|
||||||
}
|
|
||||||
Text{text: Math.round(txtslider.value * 100) + "%"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
SettingsTerminalTab{
|
||||||
Tab{
|
title: qsTr("Terminal")
|
||||||
title: qsTr("Eye-candy")
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 15
|
anchors.margins: tabmargins
|
||||||
|
}
|
||||||
ColumnLayout{
|
SettingsEffectsTab{
|
||||||
anchors.fill: parent
|
title: qsTr("Effects")
|
||||||
GroupBox{
|
anchors.fill: parent
|
||||||
title: qsTr("Rasterization")
|
anchors.margins: tabmargins
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
ColumnLayout{
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
RowLayout{
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
ExclusiveGroup { id: rasterizationgroup }
|
|
||||||
RadioButton {
|
|
||||||
text: qsTr("No Rasterization")
|
|
||||||
exclusiveGroup: rasterizationgroup
|
|
||||||
checked: shadersettings.rasterization === shadersettings.no_rasterization
|
|
||||||
onCheckedChanged: if(checked)
|
|
||||||
shadersettings.rasterization = shadersettings.no_rasterization
|
|
||||||
}
|
|
||||||
RadioButton {
|
|
||||||
text: qsTr("Scanlines")
|
|
||||||
exclusiveGroup: rasterizationgroup
|
|
||||||
checked: shadersettings.rasterization === shadersettings.scanline_rasterization
|
|
||||||
onCheckedChanged: if(checked)
|
|
||||||
shadersettings.rasterization = shadersettings.scanline_rasterization
|
|
||||||
}
|
|
||||||
RadioButton {
|
|
||||||
text: qsTr("Pixels")
|
|
||||||
exclusiveGroup: rasterizationgroup
|
|
||||||
checked: shadersettings.rasterization === shadersettings.pixel_rasterization
|
|
||||||
onCheckedChanged: if(checked)
|
|
||||||
shadersettings.rasterization = shadersettings.pixel_rasterization
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GroupBox{
|
|
||||||
title: qsTr("Effects")
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
ColumnLayout{
|
|
||||||
anchors.fill: parent
|
|
||||||
SettingComponent{
|
|
||||||
name: "Bloom"
|
|
||||||
onValueChanged: shadersettings.bloom_strength = value
|
|
||||||
_value: shadersettings.bloom_strength
|
|
||||||
}
|
|
||||||
SettingComponent{
|
|
||||||
name: "Motion Blur"
|
|
||||||
onValueChanged: shadersettings.motion_blur = value
|
|
||||||
_value: shadersettings.motion_blur
|
|
||||||
}
|
|
||||||
SettingComponent{
|
|
||||||
name: "Noise"
|
|
||||||
onValueChanged: shadersettings.noise_strength = value
|
|
||||||
_value: shadersettings.noise_strength
|
|
||||||
}
|
|
||||||
SettingComponent{
|
|
||||||
name: "Jitter"
|
|
||||||
onValueChanged: shadersettings.jitter = value
|
|
||||||
_value: shadersettings.jitter
|
|
||||||
}
|
|
||||||
SettingComponent{
|
|
||||||
name: "Glow"
|
|
||||||
onValueChanged: shadersettings.glowing_line_strength = value;
|
|
||||||
_value: shadersettings.glowing_line_strength
|
|
||||||
}
|
|
||||||
SettingComponent{
|
|
||||||
name: "Ambient light"
|
|
||||||
onValueChanged: shadersettings.ambient_light = value;
|
|
||||||
_value: shadersettings.ambient_light
|
|
||||||
}
|
|
||||||
SettingComponent{
|
|
||||||
name: "Screen distortion"
|
|
||||||
onValueChanged: shadersettings.screen_distortion = value;
|
|
||||||
_value: shadersettings.screen_distortion;
|
|
||||||
}
|
|
||||||
SettingComponent{
|
|
||||||
name: "Brightness flickering"
|
|
||||||
onValueChanged: shadersettings.brightness_flickering= value;
|
|
||||||
_value: shadersettings.brightness_flickering;
|
|
||||||
}
|
|
||||||
SettingComponent{
|
|
||||||
name: "Horizontal flickering"
|
|
||||||
onValueChanged: shadersettings.horizontal_sincronization = value;
|
|
||||||
_value: shadersettings.horizontal_sincronization;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,6 @@ Item{
|
|||||||
fontMetrics.font = currentfont.name;
|
fontMetrics.font = currentfont.name;
|
||||||
fontMetrics.font.pixelSize = currentfont.pixelSize;
|
fontMetrics.font.pixelSize = currentfont.pixelSize;
|
||||||
currentfont.paintedSize = Qt.size(fontMetrics.paintedWidth, fontMetrics.paintedHeight)
|
currentfont.paintedSize = Qt.size(fontMetrics.paintedWidth, fontMetrics.paintedHeight)
|
||||||
console.log(Qt.size(fontMetrics.paintedWidth, fontMetrics.paintedHeight))
|
|
||||||
currentfont.virtualCharSize = fontManager.item.virtualCharSize !== undefined ?
|
currentfont.virtualCharSize = fontManager.item.virtualCharSize !== undefined ?
|
||||||
fontManager.item.virtualCharSize :
|
fontManager.item.virtualCharSize :
|
||||||
Qt.size(currentfont.paintedSize.width * 0.5,
|
Qt.size(currentfont.paintedSize.width * 0.5,
|
||||||
@ -134,7 +133,6 @@ Item{
|
|||||||
|
|
||||||
property alias profiles_list: profileslist
|
property alias profiles_list: profileslist
|
||||||
property int profiles_index: 0
|
property int profiles_index: 0
|
||||||
onProfiles_indexChanged: loadProfile(profiles_index);
|
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: framelist
|
id: framelist
|
||||||
@ -269,6 +267,10 @@ Item{
|
|||||||
return JSON.stringify(customProfiles);
|
return JSON.stringify(customProfiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadCurrentProfile(){
|
||||||
|
loadProfile(profiles_index);
|
||||||
|
}
|
||||||
|
|
||||||
function loadProfile(index){
|
function loadProfile(index){
|
||||||
var profile = profileslist.get(index);
|
var profile = profileslist.get(index);
|
||||||
loadProfileString(profile.obj_string);
|
loadProfileString(profile.obj_string);
|
||||||
|
@ -23,21 +23,28 @@ import QtQuick.Controls 1.1
|
|||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
property string name
|
property alias value: slider.value
|
||||||
property double value: 0.0
|
property alias stepSize: slider.stepSize
|
||||||
property double stepSize: 0.01
|
property alias minimumValue: slider.minimumValue
|
||||||
|
property alias maximumValue: slider.maximumValue
|
||||||
|
property real maxMultiplier: 100
|
||||||
|
|
||||||
id: setting_component
|
id: setting_component
|
||||||
spacing: 10
|
spacing: 10
|
||||||
Slider{
|
Slider{
|
||||||
id: slider
|
id: slider
|
||||||
stepSize: parent.stepSize
|
stepSize: parent.stepSize
|
||||||
onValueChanged: setting_component.value = slider.value;
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
value: setting_component.value
|
|
||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
id: textfield
|
id: textfield
|
||||||
text: Math.round(value * 100) + "%"
|
text: formatNumber(Math.round(value * maxMultiplier))
|
||||||
|
}
|
||||||
|
function formatNumber(num) {
|
||||||
|
var n = "" + num;
|
||||||
|
while (n.length < 3) {
|
||||||
|
n = " " + n;
|
||||||
|
}
|
||||||
|
return n + "%";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-06-23T13:29:12. -->
|
<!-- Written by QtCreator 3.0.1, 2014-06-23T18:33:18. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user