From 950ebf5b08aba97e024e26af54a912a16b6ec30a Mon Sep 17 00:00:00 2001 From: matzman666 Date: Thu, 29 Dec 2016 13:35:38 +0100 Subject: [PATCH] Added granularity of some Revive spinner buttons. --- bin/win64/res/qml/RevivePage.qml | 130 +++++++++++++++---------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/bin/win64/res/qml/RevivePage.qml b/bin/win64/res/qml/RevivePage.qml index d59a827..b15bffc 100644 --- a/bin/win64/res/qml/RevivePage.qml +++ b/bin/win64/res/qml/RevivePage.qml @@ -259,7 +259,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "-" onClicked: { - thumbRangeSlider.decrease() + thumbRangeSlider.value -= 0.1 } } @@ -284,7 +284,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "+" onClicked: { - thumbRangeSlider.increase() + thumbRangeSlider.value += 0.1 } } @@ -342,69 +342,10 @@ MyStackViewPage { GridLayout { columns: 12 - MyText { - text: "Pitch:" - horizontalAlignment: Text.AlignRight - Layout.preferredWidth: 80 - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: touchPitchMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - var val = ReviveTabController.touchPitch - 0.1 - if (val < -180.0) { - val = -180.0 - } - ReviveTabController.setTouchPitch(val.toFixed(1)) - } - } - - MyTextField { - id: touchPitchInputField - text: "0.00" - keyBoardUID: 201 - Layout.preferredWidth: 140 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < -180.0) { - val = -180.0 - } else if (val > 180.0) { - val = 180.0 - } - var v = val.toFixed(1) - ReviveTabController.setTouchPitch(v, false) - text = v + "°" - } else { - text = ReviveTabController.touchPitch.toFixed(1) + "°" - } - } - } - - MyPushButton2 { - id: touchPitchPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - var val = ReviveTabController.touchPitch + 0.1 - if (val > 180.0) { - val = 180.0 - } - ReviveTabController.setTouchPitch(val.toFixed(1)) - } - } - MyText { text: "Yaw:" Layout.fillWidth: true horizontalAlignment: Text.AlignRight - Layout.leftMargin: 12 Layout.rightMargin: 12 } @@ -413,7 +354,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "-" onClicked: { - var val = ReviveTabController.touchYaw - 0.1 + var val = ReviveTabController.touchYaw - 1.0 if (val < -180.0) { val = -180.0 } @@ -451,7 +392,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "+" onClicked: { - var val = ReviveTabController.touchYaw + 0.1 + var val = ReviveTabController.touchYaw + 1.0 if (val > 180.0) { val = 180.0 } @@ -459,6 +400,65 @@ MyStackViewPage { } } + MyText { + text: "Pitch:" + horizontalAlignment: Text.AlignRight + Layout.preferredWidth: 80 + Layout.leftMargin: 12 + Layout.rightMargin: 12 + } + + MyPushButton2 { + id: touchPitchMinusButton + Layout.preferredWidth: 40 + text: "-" + onClicked: { + var val = ReviveTabController.touchPitch - 1.0 + if (val < -180.0) { + val = -180.0 + } + ReviveTabController.setTouchPitch(val.toFixed(1)) + } + } + + MyTextField { + id: touchPitchInputField + text: "0.00" + keyBoardUID: 201 + Layout.preferredWidth: 140 + Layout.leftMargin: 10 + Layout.rightMargin: 10 + horizontalAlignment: Text.AlignHCenter + function onInputEvent(input) { + var val = parseFloat(input) + if (!isNaN(val)) { + if (val < -180.0) { + val = -180.0 + } else if (val > 180.0) { + val = 180.0 + } + var v = val.toFixed(1) + ReviveTabController.setTouchPitch(v, false) + text = v + "°" + } else { + text = ReviveTabController.touchPitch.toFixed(1) + "°" + } + } + } + + MyPushButton2 { + id: touchPitchPlusButton + Layout.preferredWidth: 40 + text: "+" + onClicked: { + var val = ReviveTabController.touchPitch + 1.0 + if (val > 180.0) { + val = 180.0 + } + ReviveTabController.setTouchPitch(val.toFixed(1)) + } + } + MyText { text: "Roll:" Layout.fillWidth: true @@ -472,7 +472,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "-" onClicked: { - var val = ReviveTabController.touchRoll - 0.1 + var val = ReviveTabController.touchRoll - 1.0 if (val < -180.0) { val = -180.0 } @@ -510,7 +510,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "+" onClicked: { - var val = ReviveTabController.touchRoll + 0.1 + var val = ReviveTabController.touchRoll + 1.0 if (val > 180.0) { val = 180.0 }