From 4d81b3bdbd7bf9d39dc487f598962785ed21f595 Mon Sep 17 00:00:00 2001 From: Kung-vr Date: Sun, 20 Oct 2019 18:22:52 +0900 Subject: [PATCH] Optimise PlayspacePage QML, add debug toggle to Settings page --- src/res/qml/PlayspacePage.qml | 38 +++++++++++++++++++---------------- src/res/qml/SettingsPage.qml | 16 +++++++++++++++ 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/res/qml/PlayspacePage.qml b/src/res/qml/PlayspacePage.qml index 0b03259..cc29c9a 100644 --- a/src/res/qml/PlayspacePage.qml +++ b/src/res/qml/PlayspacePage.qml @@ -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 diff --git a/src/res/qml/SettingsPage.qml b/src/res/qml/SettingsPage.qml index 6a15d22..aadd826 100644 --- a/src/res/qml/SettingsPage.qml +++ b/src/res/qml/SettingsPage.qml @@ -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