Optimise PlayspacePage QML, add debug toggle to Settings page

This commit is contained in:
Kung-vr
2019-10-20 18:22:52 +09:00
parent e17e8b64b3
commit 4d81b3bdbd
2 changed files with 37 additions and 17 deletions
+21 -17
View File
@@ -530,11 +530,12 @@ MyStackViewPage {
if (MoveCenterTabController.trackingUniverse === 0) {
spaceModeText.text = "Sitting"
spaceSeatedRecenter.visible = true
offsetsGroupBox.visible = MoveCenterTabController.enableSeatedMotion
rotationGroupBox.visible = MoveCenterTabController.enableSeatedMotion
resetButtonRow.visible = MoveCenterTabController.enableSeatedMotion
profileSection.visible = MoveCenterTabController.enableSeatedMotion
seatedDisableWarningText.visible = !MoveCenterTabController.enableSeatedMotion
var boolEnableSeatedMotion = MoveCenterTabController.enableSeatedMotion
offsetsGroupBox.visible = boolEnableSeatedMotion
rotationGroupBox.visible = boolEnableSeatedMotion
resetButtonRow.visible = boolEnableSeatedMotion
profileSection.visible = boolEnableSeatedMotion
seatedDisableWarningText.visible = !boolEnableSeatedMotion
} else if (MoveCenterTabController.trackingUniverse === 1) {
spaceModeText.text = "Standing"
@@ -570,8 +571,9 @@ MyStackViewPage {
spaceRotationSlider.value = ( MoveCenterTabController.rotation / 100 )
}
onTempRotationChanged: {
spaceRotationSlider.value = ( MoveCenterTabController.tempRotation / 100 )
spaceRotationText.text = ( MoveCenterTabController.tempRotation / 100 ) + "°"
var intTempRotation = MoveCenterTabController.tempRotation
spaceRotationSlider.value = ( intTempRotation / 100 )
spaceRotationText.text = ( intTempRotation / 100 ) + "°"
}
onAdjustChaperoneChanged: {
spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
@@ -589,22 +591,24 @@ MyStackViewPage {
if (MoveCenterTabController.trackingUniverse === 0) {
spaceModeText.text = "Sitting"
spaceSeatedRecenter.visible = true
offsetsGroupBox.visible = MoveCenterTabController.enableSeatedMotion
rotationGroupBox.visible = MoveCenterTabController.enableSeatedMotion
resetButtonRow.visible = MoveCenterTabController.enableSeatedMotion
profileSection.visible = MoveCenterTabController.enableSeatedMotion
seatedDisableWarningText.visible = !MoveCenterTabController.enableSeatedMotion
var boolEnableSeatedMotion = MoveCenterTabController.enableSeatedMotion
offsetsGroupBox.visible = boolEnableSeatedMotion
rotationGroupBox.visible = boolEnableSeatedMotion
resetButtonRow.visible = boolEnableSeatedMotion
profileSection.visible = boolEnableSeatedMotion
seatedDisableWarningText.visible = !boolEnableSeatedMotion
}
}
onTrackingUniverseChanged: {
if (MoveCenterTabController.trackingUniverse === 0) {
spaceModeText.text = "Sitting"
spaceSeatedRecenter.visible = true
offsetsGroupBox.visible = MoveCenterTabController.enableSeatedMotion
rotationGroupBox.visible = MoveCenterTabController.enableSeatedMotion
resetButtonRow.visible = MoveCenterTabController.enableSeatedMotion
profileSection.visible = MoveCenterTabController.enableSeatedMotion
seatedDisableWarningText.visible = !MoveCenterTabController.enableSeatedMotion
var boolEnableSeatedMotion = MoveCenterTabController.enableSeatedMotion
offsetsGroupBox.visible = boolEnableSeatedMotion
rotationGroupBox.visible = boolEnableSeatedMotion
resetButtonRow.visible = boolEnableSeatedMotion
profileSection.visible = boolEnableSeatedMotion
seatedDisableWarningText.visible = !boolEnableSeatedMotion
} else if (MoveCenterTabController.trackingUniverse === 1) {
spaceModeText.text = "Standing"
spaceSeatedRecenter.visible = false
+16
View File
@@ -165,6 +165,22 @@ MyStackViewPage {
Layout.fillHeight: true
}
RowLayout {
Layout.fillWidth: true
Item {
Layout.fillWidth: true
}
MyToggleButton {
id: debugToggle
text: "Debug"
onCheckedChanged: {
OverlayController.setEnableDebug(checked, true)
}
}
}
Component.onCompleted: {
settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled