New chaperone adjust system and height toggle action (and Ykeara's PTT fix) (#108)
* Improve reset function and velocity timing * fixed PTT checkbox error * Rewrite of chaperone adjust. Make drift impossible * Formatting * fixed mic mute on exit * format * Clean up interactions with new chaperone adjust * Remove commented code * Implement height toggle action and ui
This commit is contained in:
@@ -5,6 +5,7 @@ import ovras.advsettings 1.0
|
||||
import "../common"
|
||||
import "universe_drag"
|
||||
import "universe_turn"
|
||||
import "height_toggle"
|
||||
|
||||
MyStackViewPage {
|
||||
headerText: "Motion Settings"
|
||||
@@ -16,6 +17,8 @@ MyStackViewPage {
|
||||
|
||||
UniverseTurnGroupBox { id: universeTurnGroupBox }
|
||||
|
||||
HeightToggleGroupBox { id: heightToggleGroupBox }
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
id: heightToggleGroupBox
|
||||
Layout.fillWidth: true
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Height Toggle / Gravity Floor Offset"
|
||||
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: heightToggleButton
|
||||
text: "On"
|
||||
onCheckedChanged: {
|
||||
MoveCenterTabController.heightToggle = this.checked
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MyText {
|
||||
text: "Height Offset (+ is down):"
|
||||
horizontalAlignment: Text.AlignRight
|
||||
Layout.rightMargin: 10
|
||||
}
|
||||
|
||||
MyTextField {
|
||||
id: heightToggleOffsetText
|
||||
text: "-1.00"
|
||||
keyBoardUID: 151
|
||||
Layout.preferredWidth: 140
|
||||
Layout.leftMargin: 10
|
||||
Layout.rightMargin: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
function onInputEvent(input) {
|
||||
var val = parseFloat(input)
|
||||
if (!isNaN(val)) {
|
||||
MoveCenterTabController.heightToggleOffset = val.toFixed(2)
|
||||
text = MoveCenterTabController.heightToggleOffset.toFixed(2)
|
||||
} else {
|
||||
text = MoveCenterTabController.heighToggleOffset.toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: heightOffsetFromYOffsetButton
|
||||
Layout.preferredWidth: 230
|
||||
text:"Set From Y-Offset"
|
||||
onClicked: {
|
||||
MoveCenterTabController.heightToggleOffset = MoveCenterTabController.offsetY
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
heightToggleButton.checked = MoveCenterTabController.heightToggle
|
||||
heightToggleOffsetText.text = MoveCenterTabController.heightToggleOffset.toFixed(2)
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: MoveCenterTabController
|
||||
|
||||
onHeightToggleChanged: {
|
||||
heightToggleButton.checked = MoveCenterTabController.heightToggle
|
||||
}
|
||||
onHeightToggleOffsetChanged: {
|
||||
heightToggleOffsetText.text = MoveCenterTabController.heightToggleOffset.toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user