Add motion page, comfort mode, rename "room" to "space"

This commit is contained in:
Kung-vr
2019-02-10 23:55:48 +09:00
parent be19793b48
commit 55e0915fc4
16 changed files with 585 additions and 182 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ import "common"
MyStackViewPage {
headerText: "Room Fix"
headerText: "Space Fix"
content: ColumnLayout {
spacing: 18
@@ -57,7 +57,7 @@ MyStackViewPage {
MyPushButton {
id: recenterButton
Layout.fillWidth: true
text: "Recenter Room"
text: "Recenter Space"
Layout.preferredHeight: 100
onClicked: {
FixFloorTabController.recenterClicked()
@@ -75,9 +75,9 @@ MyStackViewPage {
}
MyPushButton {
id: zeroRoomButton
id: zeroSpaceButton
Layout.fillWidth: true
text: "Apply Room Settings Offsets as Center"
text: "Apply Space Settings Offsets as Center"
Layout.preferredHeight: 100
onClicked: {
MoveCenterTabController.zeroOffsets()
+58 -58
View File
@@ -6,7 +6,7 @@ import "common"
MyStackViewPage {
headerText: "Room Settings"
headerText: "Space Settings"
content: ColumnLayout {
spacing: 18
@@ -17,7 +17,7 @@ MyStackViewPage {
Layout.preferredWidth: 230
}
MyText {
id: roomModeText
id: spaceModeText
font.bold: true
text: "Standing"
}
@@ -28,7 +28,7 @@ MyStackViewPage {
label: MyText {
leftPadding: 10
text: "Move Room"
text: "Move Space"
bottomPadding: -10
}
background: Rectangle {
@@ -60,7 +60,7 @@ MyStackViewPage {
}
MyPushButton2 {
id: roomMoveXMinusButton
id: spaceMoveXMinusButton
Layout.preferredWidth: 40
text: "-"
onClicked: {
@@ -69,7 +69,7 @@ MyStackViewPage {
}
MyTextField {
id: roomMoveXText
id: spaceMoveXText
text: "0.00"
keyBoardUID: 101
Layout.preferredWidth: 140
@@ -88,7 +88,7 @@ MyStackViewPage {
}
MyPushButton2 {
id: roomMoveXPlusButton
id: spaceMoveXPlusButton
Layout.preferredWidth: 40
text: "+"
onClicked: {
@@ -126,7 +126,7 @@ MyStackViewPage {
}
MyTextField {
id: roomMoveYText
id: spaceMoveYText
text: "0.00"
keyBoardUID: 102
Layout.preferredWidth: 140
@@ -180,7 +180,7 @@ MyStackViewPage {
}
MyTextField {
id: roomMoveZText
id: spaceMoveZText
text: "0.00"
keyBoardUID: 103
Layout.preferredWidth: 140
@@ -223,7 +223,7 @@ MyStackViewPage {
label: MyText {
leftPadding: 10
text: "Rotate Room"
text: "Rotate Space"
bottomPadding: -10
}
background: Rectangle {
@@ -245,7 +245,7 @@ MyStackViewPage {
ColumnLayout {
RowLayout {
MyPushButton2 {
id: roomRotationMinusButton
id: spaceRotationMinusButton
Layout.preferredWidth: 40
text: "-"
onClicked: {
@@ -258,7 +258,7 @@ MyStackViewPage {
}
MySlider {
id: roomRotationSlider
id: spaceRotationSlider
from: -180
to: 180
stepSize: 0.01
@@ -269,13 +269,13 @@ MyStackViewPage {
MoveCenterTabController.tempRotation = Math.round(val * 100)
}
onValueChanged: {
MoveCenterTabController.tempRotation = Math.round(roomRotationSlider.value * 100)
//roomRotationText.text = Math.round(roomRotationSlider.value) + "°"
MoveCenterTabController.tempRotation = Math.round(spaceRotationSlider.value * 100)
//spaceRotationText.text = Math.round(spaceRotationSlider.value) + "°"
}
}
MyPushButton2 {
id: roomRotationPlusButton
id: spaceRotationPlusButton
Layout.preferredWidth: 40
text: "+"
onClicked: {
@@ -288,7 +288,7 @@ MyStackViewPage {
}
MyTextField {
id: roomRotationText
id: spaceRotationText
text: "0°"
keyBoardUID: 104
Layout.preferredWidth: 150
@@ -306,7 +306,7 @@ MyStackViewPage {
}
}
MyPushButton {
id: roomRotationApplyButton
id: spaceRotationApplyButton
Layout.preferredWidth: 145
text:"Apply"
onClicked: {
@@ -316,15 +316,15 @@ MyStackViewPage {
}
MyToggleButton {
id: roomRotateHandToggle
text: "Enable Room-Turn Binding"
id: spaceRotateHandToggle
text: "Enable Space-Turn Binding"
onCheckedChanged: {
MoveCenterTabController.rotateHand = this.checked
}
}
MyText {
text: "Note: TurnSignal will ignore turning during Room-Turn rotation."
text: "Note: TurnSignal will ignore turning during Space-Turn rotation."
font.pointSize: 15.0
}
}
@@ -336,7 +336,7 @@ MyStackViewPage {
label: MyText {
leftPadding: 10
text: "Room Drag Binding"
text: "Space Drag Binding"
bottomPadding: -10
}
background: Rectangle {
@@ -372,7 +372,7 @@ MyStackViewPage {
Layout.fillWidth: true
MyPushButton {
id: roomResetButton
id: spaceResetButton
Layout.preferredWidth: 250
text: "Reset"
onClicked: {
@@ -381,7 +381,7 @@ MyStackViewPage {
}
MyToggleButton {
id: roomAdjustChaperoneToggle
id: spaceAdjustChaperoneToggle
text: "Adjust Chaperone"
onCheckedChanged: {
MoveCenterTabController.adjustChaperone = this.checked
@@ -396,12 +396,12 @@ MyStackViewPage {
Item { Layout.fillHeight: true; Layout.fillWidth: true}
Component.onCompleted: {
roomAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
roomRotateHandToggle.checked = MoveCenterTabController.rotateHand
roomMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
roomMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
roomMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
roomRotationSlider.value = MoveCenterTabController.rotation
spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
spaceRotateHandToggle.checked = MoveCenterTabController.rotateHand
spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
spaceRotationSlider.value = MoveCenterTabController.rotation
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft
lockXToggle.checked = MoveCenterTabController.lockXToggle
@@ -409,45 +409,45 @@ MyStackViewPage {
lockZToggle.checked = MoveCenterTabController.lockZToggle
if (MoveCenterTabController.trackingUniverse === 0) {
roomModeText.text = "Sitting"
roomRotationPlusButton.enabled = false
roomRotationMinusButton.enabled = false
roomRotationSlider.enabled = false
roomRotationText.text = "-"
spaceModeText.text = "Sitting"
spaceRotationPlusButton.enabled = false
spaceRotationMinusButton.enabled = false
spaceRotationSlider.enabled = false
spaceRotationText.text = "-"
} else if (MoveCenterTabController.trackingUniverse === 1) {
roomModeText.text = "Standing"
roomRotationPlusButton.enabled = true
roomRotationMinusButton.enabled = true
roomRotationSlider.enabled = true
roomRotationText.text = "0°"
spaceModeText.text = "Standing"
spaceRotationPlusButton.enabled = true
spaceRotationMinusButton.enabled = true
spaceRotationSlider.enabled = true
spaceRotationText.text = "0°"
} else {
roomModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
}
}
Connections {
target: MoveCenterTabController
onOffsetXChanged: {
roomMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
}
onOffsetYChanged: {
roomMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
}
onOffsetZChanged: {
roomMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
}
onRotationChanged: {
roomRotationSlider.value = ( MoveCenterTabController.rotation / 100 )
spaceRotationSlider.value = ( MoveCenterTabController.rotation / 100 )
}
onTempRotationChanged: {
roomRotationSlider.value = ( MoveCenterTabController.tempRotation / 100 )
roomRotationText.text = ( MoveCenterTabController.tempRotation / 100 ) + "°"
spaceRotationSlider.value = ( MoveCenterTabController.tempRotation / 100 )
spaceRotationText.text = ( MoveCenterTabController.tempRotation / 100 ) + "°"
}
onAdjustChaperoneChanged: {
roomAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
}
onRotateHandChanged: {
roomRotateHandToggle.checked = MoveCenterTabController.rotateHand
spaceRotateHandToggle.checked = MoveCenterTabController.rotateHand
}
onMoveShortcutRightChanged: {
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
@@ -466,19 +466,19 @@ MyStackViewPage {
}
onTrackingUniverseChanged: {
if (MoveCenterTabController.trackingUniverse === 0) {
roomModeText.text = "Sitting"
roomRotationPlusButton.enabled = false
roomRotationMinusButton.enabled = false
roomRotationSlider.enabled = false
roomRotationText.text = "-"
spaceModeText.text = "Sitting"
spaceRotationPlusButton.enabled = false
spaceRotationMinusButton.enabled = false
spaceRotationSlider.enabled = false
spaceRotationText.text = "-"
} else if (MoveCenterTabController.trackingUniverse === 1) {
roomModeText.text = "Standing"
roomRotationPlusButton.enabled = true
roomRotationMinusButton.enabled = true
roomRotationSlider.enabled = true
roomRotationText.text = "0°"
spaceModeText.text = "Standing"
spaceRotationPlusButton.enabled = true
spaceRotationMinusButton.enabled = true
spaceRotationSlider.enabled = true
spaceRotationText.text = "0°"
} else {
roomModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
}
}
}
+13 -2
View File
@@ -50,7 +50,7 @@ MyStackViewPage {
MyPushButton {
id: playSpaceButton
activationSoundEnabled: false
text: "Room Settings"
text: "Offsets"
Layout.fillWidth: true
onClicked: {
MyResources.playFocusChangedSound()
@@ -58,10 +58,21 @@ MyStackViewPage {
}
}
MyPushButton {
id: motionButton
activationSoundEnabled: false
text: "Motion"
Layout.fillWidth: true
onClicked: {
MyResources.playFocusChangedSound()
mainView.push(motionPage)
}
}
MyPushButton {
id: fixFloorButton
activationSoundEnabled: false
text: "Room Fix"
text: "Space Fix"
Layout.fillWidth: true
onClicked: {
MyResources.playFocusChangedSound()
+6
View File
@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.0
import ".."
import "../utilities_page"
import "../audio_page"
import "../motion_page"
Rectangle {
id: root
@@ -35,6 +36,11 @@ Rectangle {
visible: false
}
property MotionPage motionPage: MotionPage {
stackView: mainView
visible: false
}
property FixFloorPage fixFloorPage: FixFloorPage {
stackView: mainView
visible: false
+24
View File
@@ -0,0 +1,24 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import "../common"
import "universe_drag"
import "universe_turn"
MyStackViewPage {
headerText: "Motion Settings"
content: ColumnLayout {
spacing: 18
UniverseDragGroupBox { id: universeDragGroupBox }
UniverseTurnGroupBox { id: universeTurnGroupBox }
Item {
Layout.fillHeight: true
}
}
}
@@ -0,0 +1,104 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import "../../common"
GroupBox {
id: universeDragGroupBox
Layout.fillWidth: true
label: MyText {
leftPadding: 10
text: "Universe Drag"
bottomPadding: -10
}
background: Rectangle {
color: "transparent"
border.color: "#ffffff"
radius: 8
}
ColumnLayout {
anchors.fill: parent
Rectangle {
color: "#ffffff"
height: 1
Layout.fillWidth: true
Layout.bottomMargin: 5
}
RowLayout {
Layout.fillWidth: true
MyToggleButton {
id: moveShortcutLeft
text: "Enable Left Hand"
onCheckedChanged: {
MoveCenterTabController.moveShortcutLeft = this.checked
}
}
MyToggleButton {
id: moveShortcutRight
text: "Enable Right Hand"
onCheckedChanged: {
MoveCenterTabController.moveShortcutRight = this.checked
}
}
Item {
Layout.fillWidth: true
}
MyText {
text: "Drag Comfort Mode:"
horizontalAlignment: Text.AlignRight
Layout.rightMargin: 10
}
MySlider {
id: dragComfortSlider
from: 0
to: 10
stepSize: 1
value: 0
Layout.preferredWidth: 200
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onValueChanged: {
dragComfortText.text = dragComfortSlider.value
MoveCenterTabController.dragComfortFactor = dragComfortSlider.value
}
}
MyText {
id: dragComfortText
text: "0"
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 30
Layout.rightMargin: 10
}
}
}
Component.onCompleted: {
moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
dragComfortSlider.value = MoveCenterTabController.dragComfortFactor
}
Connections {
target: MoveCenterTabController
onMoveShortcutLeftChanged: {
moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft
}
onMoveShortcutRightChanged: {
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
}
onDragComfortFactorChanged: {
dragComfortSlider.value = MoveCenterTabController.dragComfortFactor
}
}
}
@@ -0,0 +1,104 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import "../../common"
GroupBox {
id: universeTurnGroupBox
Layout.fillWidth: true
label: MyText {
leftPadding: 10
text: "Universe Turn"
bottomPadding: -10
}
background: Rectangle {
color: "transparent"
border.color: "#ffffff"
radius: 8
}
ColumnLayout {
anchors.fill: parent
Rectangle {
color: "#ffffff"
height: 1
Layout.fillWidth: true
Layout.bottomMargin: 5
}
RowLayout {
Layout.fillWidth: true
MyToggleButton {
id: turnBindLeft
text: "Enable Left Hand"
onCheckedChanged: {
MoveCenterTabController.turnBindLeft = this.checked
}
}
MyToggleButton {
id: turnBindRight
text: "Enable Right Hand"
onCheckedChanged: {
MoveCenterTabController.turnBindRight = this.checked
}
}
Item {
Layout.fillWidth: true
}
MyText {
text: "Turn Comfort Mode:"
horizontalAlignment: Text.AlignRight
Layout.rightMargin: 10
}
MySlider {
id: turnComfortSlider
from: 0
to: 10
stepSize: 1
value: 0
Layout.preferredWidth: 200
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onValueChanged: {
turnComfortText.text = turnComfortSlider.value
MoveCenterTabController.turnComfortFactor = turnComfortSlider.value
}
}
MyText {
id: turnComfortText
text: "0"
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 30
Layout.rightMargin: 10
}
}
}
Component.onCompleted: {
turnBindLeft.checked = MoveCenterTabController.turnBindLeft
turnBindRight.checked = MoveCenterTabController.turnBindRight
turnComfortSlider.value = MoveCenterTabController.turnComfortFactor
}
Connections {
target: MoveCenterTabController
onTurnBindLeftChanged: {
turnBindLeft.checked = MoveCenterTabController.turnBindLeft
}
onTurnBindRightChanged: {
turnBindRight.checked = MoveCenterTabController.turnBindRight
}
onTurnComfortFactorChanged: {
turnComfortSlider.value = MoveCenterTabController.turnComfortFactor
}
}
}