Clean up offsets tab ui

This commit is contained in:
Kung-vr
2019-03-19 15:05:02 +09:00
parent 925d67cf38
commit bdf4227e5c
3 changed files with 1 additions and 78 deletions
+1 -47
View File
@@ -6,7 +6,7 @@ import "common"
MyStackViewPage { MyStackViewPage {
headerText: "Space Settings" headerText: "Space Offsets"
content: ColumnLayout { content: ColumnLayout {
spacing: 18 spacing: 18
@@ -314,19 +314,6 @@ MyStackViewPage {
} }
} }
} }
MyToggleButton {
id: spaceRotateHandToggle
text: "Enable Space-Turn Binding"
onCheckedChanged: {
MoveCenterTabController.rotateHand = this.checked
}
}
MyText {
text: "Note: TurnSignal will ignore turning during Space-Turn rotation."
font.pointSize: 15.0
}
} }
} }
} }
@@ -344,27 +331,6 @@ MyStackViewPage {
border.color: "#ffffff" border.color: "#ffffff"
radius: 8 radius: 8
} }
ColumnLayout {
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
}
}
}
}
} }
ColumnLayout { ColumnLayout {
@@ -397,13 +363,10 @@ MyStackViewPage {
Component.onCompleted: { Component.onCompleted: {
spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
spaceRotateHandToggle.checked = MoveCenterTabController.rotateHand
spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2) spaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2) spaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2) spaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
spaceRotationSlider.value = MoveCenterTabController.rotation spaceRotationSlider.value = MoveCenterTabController.rotation
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft
lockXToggle.checked = MoveCenterTabController.lockXToggle lockXToggle.checked = MoveCenterTabController.lockXToggle
lockYToggle.checked = MoveCenterTabController.lockYToggle lockYToggle.checked = MoveCenterTabController.lockYToggle
lockZToggle.checked = MoveCenterTabController.lockZToggle lockZToggle.checked = MoveCenterTabController.lockZToggle
@@ -445,15 +408,6 @@ MyStackViewPage {
} }
onAdjustChaperoneChanged: { onAdjustChaperoneChanged: {
spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
}
onRotateHandChanged: {
spaceRotateHandToggle.checked = MoveCenterTabController.rotateHand
}
onMoveShortcutRightChanged: {
moveShortcutRight.checked = MoveCenterTabController.moveShortcutRight
}
onMoveShortcutLeftChanged: {
moveShortcutLeft.checked = MoveCenterTabController.moveShortcutLeft
} }
onLockXToggleChanged: { onLockXToggleChanged: {
lockXToggle.checked = MoveCenterTabController.lockXToggle lockXToggle.checked = MoveCenterTabController.lockXToggle
@@ -46,11 +46,6 @@ void MoveCenterTabController::initStage1()
{ {
m_adjustChaperone = value.toBool(); m_adjustChaperone = value.toBool();
} }
value = settings->value( "rotateHand", m_settingsHandTurningEnabled );
if ( value.isValid() && !value.isNull() )
{
m_settingsHandTurningEnabled = value.toBool();
}
value = settings->value( "moveShortcutRight", value = settings->value( "moveShortcutRight",
m_settingsRightHandDragEnabled ); m_settingsRightHandDragEnabled );
if ( value.isValid() && !value.isNull() ) if ( value.isValid() && !value.isNull() )
@@ -283,25 +278,6 @@ void MoveCenterTabController::setAdjustChaperone( bool value, bool notify )
} }
} }
bool MoveCenterTabController::rotateHand() const
{
return m_settingsHandTurningEnabled;
}
void MoveCenterTabController::setRotateHand( bool value, bool notify )
{
m_settingsHandTurningEnabled = value;
auto settings = OverlayController::appSettings();
settings->beginGroup( "playspaceSettings" );
settings->setValue( "rotateHand", m_settingsHandTurningEnabled );
settings->endGroup();
settings->sync();
if ( notify )
{
emit rotateHandChanged( m_settingsHandTurningEnabled );
}
}
bool MoveCenterTabController::moveShortcutRight() const bool MoveCenterTabController::moveShortcutRight() const
{ {
return m_settingsRightHandDragEnabled; return m_settingsRightHandDragEnabled;
@@ -66,8 +66,6 @@ class MoveCenterTabController : public QObject
requireLockYChanged ) requireLockYChanged )
Q_PROPERTY( bool lockZToggle READ lockZToggle WRITE setLockZ NOTIFY Q_PROPERTY( bool lockZToggle READ lockZToggle WRITE setLockZ NOTIFY
requireLockZChanged ) requireLockZChanged )
Q_PROPERTY( bool rotateHand READ rotateHand WRITE setRotateHand NOTIFY
rotateHandChanged )
private: private:
OverlayController* parent; OverlayController* parent;
@@ -84,7 +82,6 @@ private:
int m_oldRotation = 0; int m_oldRotation = 0;
int m_tempRotation = 0; int m_tempRotation = 0;
bool m_adjustChaperone = true; bool m_adjustChaperone = true;
bool m_settingsHandTurningEnabled = false;
bool m_moveShortcutRightPressed = false; bool m_moveShortcutRightPressed = false;
bool m_moveShortcutLeftPressed = false; bool m_moveShortcutLeftPressed = false;
vr::TrackedDeviceIndex_t m_activeMoveController; vr::TrackedDeviceIndex_t m_activeMoveController;
@@ -174,7 +171,6 @@ public:
int rotation() const; int rotation() const;
int tempRotation() const; int tempRotation() const;
bool adjustChaperone() const; bool adjustChaperone() const;
bool rotateHand() const;
bool moveShortcutRight() const; bool moveShortcutRight() const;
bool moveShortcutLeft() const; bool moveShortcutLeft() const;
bool turnBindRight() const; bool turnBindRight() const;
@@ -228,8 +224,6 @@ public slots:
void setAdjustChaperone( bool value, bool notify = true ); void setAdjustChaperone( bool value, bool notify = true );
void setRotateHand( bool value, bool notify = true );
void setMoveShortcutRight( bool value, bool notify = true ); void setMoveShortcutRight( bool value, bool notify = true );
void setMoveShortcutLeft( bool value, bool notify = true ); void setMoveShortcutLeft( bool value, bool notify = true );
void setTurnBindRight( bool value, bool notify = true ); void setTurnBindRight( bool value, bool notify = true );
@@ -262,7 +256,6 @@ signals:
void rotationChanged( int value ); void rotationChanged( int value );
void tempRotationChanged( int value ); void tempRotationChanged( int value );
void adjustChaperoneChanged( bool value ); void adjustChaperoneChanged( bool value );
void rotateHandChanged( bool value );
void moveShortcutRightChanged( bool value ); void moveShortcutRightChanged( bool value );
void moveShortcutLeftChanged( bool value ); void moveShortcutLeftChanged( bool value );
void turnBindRightChanged( bool value ); void turnBindRightChanged( bool value );