From ccfb22c3b2cfb844b602e374abe9d7cc6f4f710b Mon Sep 17 00:00:00 2001 From: Kung-vr Date: Tue, 19 Mar 2019 15:06:47 +0900 Subject: [PATCH] Slight ui cleanup --- src/res/qml/PlayspacePage.qml | 14 ------ .../motion_page/gravity/GravityGroupBox.qml | 46 ++++++++++++++++--- .../height_toggle/HeightToggleGroupBox.qml | 4 +- .../snap_turn/SnapTurnGroupBox.qml | 24 +++------- .../MoveCenterTabController.cpp | 1 + 5 files changed, 48 insertions(+), 41 deletions(-) diff --git a/src/res/qml/PlayspacePage.qml b/src/res/qml/PlayspacePage.qml index 838285b..a762f4f 100644 --- a/src/res/qml/PlayspacePage.qml +++ b/src/res/qml/PlayspacePage.qml @@ -318,20 +318,6 @@ MyStackViewPage { } } - GroupBox { - Layout.fillWidth: true - - label: MyText { - leftPadding: 10 - text: "Space Drag Binding" - bottomPadding: -10 - } - background: Rectangle { - color: "transparent" - border.color: "#ffffff" - radius: 8 - } - } ColumnLayout { RowLayout { diff --git a/src/res/qml/motion_page/gravity/GravityGroupBox.qml b/src/res/qml/motion_page/gravity/GravityGroupBox.qml index b687342..08349ce 100644 --- a/src/res/qml/motion_page/gravity/GravityGroupBox.qml +++ b/src/res/qml/motion_page/gravity/GravityGroupBox.qml @@ -47,7 +47,7 @@ GroupBox { MyText { text: "Gravity Strength (+ is down):" horizontalAlignment: Text.AlignRight - Layout.rightMargin: 10 + Layout.rightMargin: 2 } MyTextField { @@ -118,14 +118,14 @@ GroupBox { } MyText { - text: "Fling Strength" + text: "Fling Strength:" horizontalAlignment: Text.AlignRight - Layout.rightMargin: 10 + Layout.rightMargin: 2 } MyTextField { id: flingStrengthText - text: "1.00" + text: "1.0" keyBoardUID: 153 Layout.preferredWidth: 120 Layout.leftMargin: 10 @@ -134,14 +134,46 @@ GroupBox { function onInputEvent(input) { var val = parseFloat(input) if (!isNaN(val)) { - MoveCenterTabController.flingStrength = val.toFixed(2) - text = MoveCenterTabController.flingStrength.toFixed(2) + MoveCenterTabController.flingStrength = val.toFixed(1) + text = MoveCenterTabController.flingStrength.toFixed(1) } else { - text = MoveCenterTabController.flingStrength.toFixed(2) + text = MoveCenterTabController.flingStrength.toFixed(1) } } } + MyPushButton2 { + Layout.preferredWidth: 50 + text: "1x" + onClicked: { + MoveCenterTabController.flingStrength = 1.0 + } + } + + MyPushButton2 { + Layout.preferredWidth: 50 + text: "2x" + onClicked: { + MoveCenterTabController.flingStrength = 2.0 + } + } + + MyPushButton2 { + Layout.preferredWidth: 50 + text: "3x" + onClicked: { + MoveCenterTabController.flingStrength = 3.0 + } + } + + MyPushButton2 { + Layout.preferredWidth: 50 + text: "4x" + onClicked: { + MoveCenterTabController.flingStrength = 4.0 + } + } + } } diff --git a/src/res/qml/motion_page/height_toggle/HeightToggleGroupBox.qml b/src/res/qml/motion_page/height_toggle/HeightToggleGroupBox.qml index 743ea6a..8689670 100644 --- a/src/res/qml/motion_page/height_toggle/HeightToggleGroupBox.qml +++ b/src/res/qml/motion_page/height_toggle/HeightToggleGroupBox.qml @@ -47,7 +47,7 @@ GroupBox { MyText { text: "Height Offset (+ is down):" horizontalAlignment: Text.AlignRight - Layout.rightMargin: 10 + Layout.rightMargin: 2 } MyTextField { @@ -64,7 +64,7 @@ GroupBox { MoveCenterTabController.heightToggleOffset = val.toFixed(2) text = MoveCenterTabController.heightToggleOffset.toFixed(2) } else { - text = MoveCenterTabController.heighToggleOffset.toFixed(2) + text = MoveCenterTabController.heightToggleOffset.toFixed(2) } } } diff --git a/src/res/qml/motion_page/snap_turn/SnapTurnGroupBox.qml b/src/res/qml/motion_page/snap_turn/SnapTurnGroupBox.qml index 231b2e0..5b57ba7 100644 --- a/src/res/qml/motion_page/snap_turn/SnapTurnGroupBox.qml +++ b/src/res/qml/motion_page/snap_turn/SnapTurnGroupBox.qml @@ -8,30 +8,18 @@ GroupBox { id: snapTurnGroupBox Layout.fillWidth: true - label: MyText { - leftPadding: 10 - text: "Snap Turn Angle" - 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 + MyText { + text: "Snap Turn Angle:" + horizontalAlignment: Text.AlignRight + Layout.rightMargin: 2 + } + MyTextField { id: snapTurnAngleText text: "45°" diff --git a/src/tabcontrollers/MoveCenterTabController.cpp b/src/tabcontrollers/MoveCenterTabController.cpp index 6e244a0..9fe5921 100644 --- a/src/tabcontrollers/MoveCenterTabController.cpp +++ b/src/tabcontrollers/MoveCenterTabController.cpp @@ -494,6 +494,7 @@ void MoveCenterTabController::setGravityStrength( float value, bool notify ) { emit gravityStrengthChanged( m_gravityStrength ); } + m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now(); } float MoveCenterTabController::flingStrength() const