mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 01:36:26 +02:00
Cosmetic change to the ui and adding more feature to the ConfigSlider
This commit is contained in:
parent
0b82e91405
commit
4dc3685e35
2 changed files with 75 additions and 21 deletions
|
@ -23,13 +23,22 @@ Item {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
height: 24
|
height: 24
|
||||||
|
|
||||||
|
property var labelAreaWidthScale: 0.5
|
||||||
|
|
||||||
property bool integral: false
|
property bool integral: false
|
||||||
property var config
|
property var config
|
||||||
property string property
|
property string property
|
||||||
property alias label: labelControl.text
|
|
||||||
property alias min: sliderControl.minimumValue
|
property alias min: sliderControl.minimumValue
|
||||||
property alias max: sliderControl.maximumValue
|
property alias max: sliderControl.maximumValue
|
||||||
|
|
||||||
|
property alias label: labelControl.text
|
||||||
|
property bool showLabel: true
|
||||||
|
|
||||||
|
property bool showValue: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
signal valueChanged(real value)
|
signal valueChanged(real value)
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
@ -41,20 +50,12 @@ Item {
|
||||||
HifiControls.Label {
|
HifiControls.Label {
|
||||||
id: labelControl
|
id: labelControl
|
||||||
text: root.label
|
text: root.label
|
||||||
enabled: true
|
enabled: root.showLabel
|
||||||
anchors.left: root.left
|
anchors.left: root.left
|
||||||
anchors.right: root.horizontalCenter
|
width: root.width * root.labelAreaWidthScale
|
||||||
anchors.verticalCenter: root.verticalCenter
|
anchors.verticalCenter: root.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiControls.Label {
|
|
||||||
id: labelValue
|
|
||||||
text: sliderControl.value.toFixed(root.integral ? 0 : 2)
|
|
||||||
anchors.right: root.right
|
|
||||||
anchors.bottom: root.bottom
|
|
||||||
anchors.bottomMargin: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
id: bindingControl
|
id: bindingControl
|
||||||
target: root.config
|
target: root.config
|
||||||
|
@ -66,7 +67,7 @@ Item {
|
||||||
HifiControls.Slider {
|
HifiControls.Slider {
|
||||||
id: sliderControl
|
id: sliderControl
|
||||||
stepSize: root.integral ? 1.0 : 0.0
|
stepSize: root.integral ? 1.0 : 0.0
|
||||||
anchors.left: root.horizontalCenter
|
anchors.left: labelControl.right
|
||||||
anchors.right: root.right
|
anchors.right: root.right
|
||||||
anchors.rightMargin: 0
|
anchors.rightMargin: 0
|
||||||
anchors.top: root.top
|
anchors.top: root.top
|
||||||
|
@ -74,4 +75,17 @@ Item {
|
||||||
|
|
||||||
onValueChanged: { root.valueChanged(value) }
|
onValueChanged: { root.valueChanged(value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HifiControls.Label {
|
||||||
|
id: labelValue
|
||||||
|
enabled: root.showValue
|
||||||
|
text: sliderControl.value.toFixed(root.integral ? 0 : 2)
|
||||||
|
anchors.right: labelControl.right
|
||||||
|
anchors.rightMargin: 5
|
||||||
|
anchors.verticalCenter: root.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,25 +40,65 @@ Rectangle {
|
||||||
checked: workload.spaceToRender["freezeViews"]
|
checked: workload.spaceToRender["freezeViews"]
|
||||||
onCheckedChanged: { workload.spaceToRender["freezeViews"] = checked, workload.setupViews.enabled = !checked; }
|
onCheckedChanged: { workload.spaceToRender["freezeViews"] = checked, workload.setupViews.enabled = !checked; }
|
||||||
}
|
}
|
||||||
Repeater {
|
|
||||||
model: [
|
RowLayout {
|
||||||
"R1 Back:r1Back:50.0:0.0", " Front:r1Front:300:1.0",
|
anchors.left: parent.left
|
||||||
"R2 Back:r2Back:50.0:0.0", " Front:r2Front:300:1.0",
|
anchors.right: parent.right
|
||||||
"R3 Back:r3Back:50.0:0.0", " Front:r3Front:300:1.0"
|
Column {
|
||||||
]
|
anchors.left: parent.left
|
||||||
ConfigSlider {
|
anchors.right: parent.horizontalCenter
|
||||||
|
HifiControls.Label {
|
||||||
|
text: "Back [m]"
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
}
|
||||||
|
Repeater {
|
||||||
|
model: [
|
||||||
|
"R1:r1Back:50.0:0.0",
|
||||||
|
"R2:r2Back:50.0:0.0",
|
||||||
|
"R3:r3Back:50.0:0.0"
|
||||||
|
]
|
||||||
|
ConfigSlider {
|
||||||
label: qsTr(modelData.split(":")[0])
|
label: qsTr(modelData.split(":")[0])
|
||||||
integral: false
|
|
||||||
config: workload.setupViews
|
config: workload.setupViews
|
||||||
property: modelData.split(":")[1]
|
property: modelData.split(":")[1]
|
||||||
max: modelData.split(":")[2]
|
max: modelData.split(":")[2]
|
||||||
min: modelData.split(":")[3]
|
min: modelData.split(":")[3]
|
||||||
|
integral: true
|
||||||
|
|
||||||
|
labelAreaWidthScale: 0.4
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Column {
|
||||||
|
anchors.left: parent.horizontalCenter
|
||||||
|
anchors.right: parent.right
|
||||||
|
HifiControls.Label {
|
||||||
|
text: "Front [m]"
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
}
|
||||||
|
Repeater {
|
||||||
|
model: [
|
||||||
|
"r1Front:300:1.0",
|
||||||
|
"r2Front:300:1.0",
|
||||||
|
"r3Front:300:1.0"
|
||||||
|
]
|
||||||
|
ConfigSlider {
|
||||||
|
showLabel: false
|
||||||
|
config: workload.setupViews
|
||||||
|
property: modelData.split(":")[0]
|
||||||
|
max: modelData.split(":")[1]
|
||||||
|
min: modelData.split(":")[2]
|
||||||
|
integral: true
|
||||||
|
|
||||||
|
labelAreaWidthScale: 0.3
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Separator {}
|
Separator {}
|
||||||
HifiControls.Label {
|
HifiControls.Label {
|
||||||
text: "Display"
|
text: "Display"
|
||||||
|
|
Loading…
Reference in a new issue