mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:18:38 +02:00
Merge pull request #13975 from ElderOrb/FB16697
Fix multiple issues on 'Calibration' tab of 'Controls' dialog
This commit is contained in:
commit
1ea2ab338e
3 changed files with 82 additions and 7 deletions
|
@ -83,8 +83,10 @@ SpinBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
validator: DoubleValidator {
|
validator: DoubleValidator {
|
||||||
bottom: Math.min(spinBox.from, spinBox.to)
|
decimals: spinBox.decimals
|
||||||
top: Math.max(spinBox.from, spinBox.to)
|
bottom: Math.min(spinBox.realFrom, spinBox.realTo)
|
||||||
|
top: Math.max(spinBox.realFrom, spinBox.realTo)
|
||||||
|
notation: DoubleValidator.StandardNotation
|
||||||
}
|
}
|
||||||
|
|
||||||
textFromValue: function(value, locale) {
|
textFromValue: function(value, locale) {
|
||||||
|
@ -97,20 +99,37 @@ SpinBox {
|
||||||
|
|
||||||
|
|
||||||
contentItem: TextInput {
|
contentItem: TextInput {
|
||||||
|
id: spinboxText
|
||||||
z: 2
|
z: 2
|
||||||
color: isLightColorScheme
|
color: isLightColorScheme
|
||||||
? (spinBox.activeFocus ? hifi.colors.black : hifi.colors.lightGray)
|
? (spinBox.activeFocus ? hifi.colors.black : hifi.colors.lightGray)
|
||||||
: (spinBox.activeFocus ? hifi.colors.white : hifi.colors.lightGrayText)
|
: (spinBox.activeFocus ? hifi.colors.white : hifi.colors.lightGrayText)
|
||||||
selectedTextColor: hifi.colors.black
|
selectedTextColor: hifi.colors.black
|
||||||
selectionColor: hifi.colors.primaryHighlight
|
selectionColor: hifi.colors.primaryHighlight
|
||||||
text: spinBox.textFromValue(spinBox.value, spinBox.locale) + suffix
|
text: spinBox.textFromValue(spinBox.value, spinBox.locale)
|
||||||
inputMethodHints: spinBox.inputMethodHints
|
inputMethodHints: spinBox.inputMethodHints
|
||||||
validator: spinBox.validator
|
validator: spinBox.validator
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
leftPadding: spinBoxLabelInside.visible ? 30 : hifi.dimensions.textPadding
|
leftPadding: spinBoxLabelInside.visible ? 30 : hifi.dimensions.textPadding
|
||||||
//rightPadding: hifi.dimensions.spinnerSize
|
|
||||||
width: spinBox.width - hifi.dimensions.spinnerSize
|
width: spinBox.width - hifi.dimensions.spinnerSize
|
||||||
onEditingFinished: spinBox.editingFinished()
|
onEditingFinished: spinBox.editingFinished()
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: suffixText
|
||||||
|
x: metrics.advanceWidth(spinboxText.text + '*')
|
||||||
|
height: spinboxText.height
|
||||||
|
|
||||||
|
FontMetrics {
|
||||||
|
id: metrics
|
||||||
|
font: spinboxText.font
|
||||||
|
}
|
||||||
|
|
||||||
|
color: isLightColorScheme
|
||||||
|
? (spinBox.activeFocus ? hifi.colors.black : hifi.colors.lightGray)
|
||||||
|
: (spinBox.activeFocus ? hifi.colors.white : hifi.colors.lightGrayText)
|
||||||
|
text: suffix
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
up.indicator: Item {
|
up.indicator: Item {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.2
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts 1.3
|
||||||
|
import QtQuick.Window 2.2
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
import Qt.labs.settings 1.0
|
import Qt.labs.settings 1.0
|
||||||
import stylesUit 1.0
|
import stylesUit 1.0
|
||||||
|
@ -72,6 +73,11 @@ Item {
|
||||||
initialItem: inputConfiguration
|
initialItem: inputConfiguration
|
||||||
property alias messageVisible: imageMessageBox.visible
|
property alias messageVisible: imageMessageBox.visible
|
||||||
property string selectedPlugin: ""
|
property string selectedPlugin: ""
|
||||||
|
|
||||||
|
property bool keyboardEnabled: false
|
||||||
|
property bool keyboardRaised: false
|
||||||
|
property bool punctuationMode: false
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: inputConfiguration
|
id: inputConfiguration
|
||||||
anchors {
|
anchors {
|
||||||
|
@ -227,6 +233,8 @@ Item {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: inputConfiguration.bottom
|
anchors.top: inputConfiguration.bottom
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.bottomMargin: keyboard.height
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: loader
|
id: loader
|
||||||
asynchronous: false
|
asynchronous: false
|
||||||
|
@ -248,6 +256,29 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HifiControls.Keyboard {
|
||||||
|
id: keyboard
|
||||||
|
raised: parent.keyboardEnabled && parent.keyboardRaised
|
||||||
|
onRaisedChanged: {
|
||||||
|
if (raised) {
|
||||||
|
// delayed execution to allow loader and its content to adjust size
|
||||||
|
Qt.callLater(function() {
|
||||||
|
loader.item.bringToView(Window.activeFocusItem);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
numeric: parent.punctuationMode
|
||||||
|
anchors {
|
||||||
|
bottom: parent.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
parent.keyboardEnabled = HMD.active;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function inputPlugins() {
|
function inputPlugins() {
|
||||||
if (checkBox.checked) {
|
if (checkBox.checked) {
|
||||||
|
|
|
@ -32,6 +32,18 @@ Flickable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function bringToView(item) {
|
||||||
|
var yTop = item.mapToItem(contentItem, 0, 0).y;
|
||||||
|
var yBottom = yTop + item.height;
|
||||||
|
|
||||||
|
var surfaceTop = contentY;
|
||||||
|
var surfaceBottom = contentY + height;
|
||||||
|
|
||||||
|
if(yTop < surfaceTop || yBottom > surfaceBottom) {
|
||||||
|
contentY = yTop - height / 2 + item.height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
page = config.createObject(flick.contentItem);
|
page = config.createObject(flick.contentItem);
|
||||||
}
|
}
|
||||||
|
@ -39,6 +51,8 @@ Flickable {
|
||||||
id: config
|
id: config
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: openVrConfiguration
|
id: openVrConfiguration
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
property int leftMargin: 75
|
property int leftMargin: 75
|
||||||
property int countDown: 0
|
property int countDown: 0
|
||||||
property string pluginName: ""
|
property string pluginName: ""
|
||||||
|
@ -200,6 +214,7 @@ Flickable {
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
sendConfigurationSettings();
|
sendConfigurationSettings();
|
||||||
|
openVrConfiguration.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,6 +232,7 @@ Flickable {
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
sendConfigurationSettings();
|
sendConfigurationSettings();
|
||||||
|
openVrConfiguration.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,6 +325,7 @@ Flickable {
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
sendConfigurationSettings();
|
sendConfigurationSettings();
|
||||||
|
openVrConfiguration.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,6 +342,7 @@ Flickable {
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
sendConfigurationSettings();
|
sendConfigurationSettings();
|
||||||
|
openVrConfiguration.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -550,13 +568,15 @@ Flickable {
|
||||||
width: 160
|
width: 160
|
||||||
suffix: " cm"
|
suffix: " cm"
|
||||||
label: "Arm Circumference"
|
label: "Arm Circumference"
|
||||||
minimumValue: 0
|
minimumValue: 10.0
|
||||||
|
maximumValue: 50.0
|
||||||
realStepSize: 1.0
|
realStepSize: 1.0
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
realValue: 33.0
|
realValue: 33.0
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
sendConfigurationSettings();
|
sendConfigurationSettings();
|
||||||
|
openVrConfiguration.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,7 +585,8 @@ Flickable {
|
||||||
width: 160
|
width: 160
|
||||||
label: "Shoulder Width"
|
label: "Shoulder Width"
|
||||||
suffix: " cm"
|
suffix: " cm"
|
||||||
minimumValue: 0
|
minimumValue: 25.0
|
||||||
|
maximumValue: 50.0
|
||||||
realStepSize: 1.0
|
realStepSize: 1.0
|
||||||
decimals: 1
|
decimals: 1
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
@ -573,6 +594,7 @@ Flickable {
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
sendConfigurationSettings();
|
sendConfigurationSettings();
|
||||||
|
openVrConfiguration.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -743,14 +765,17 @@ Flickable {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: leftMargin
|
anchors.leftMargin: leftMargin
|
||||||
|
|
||||||
minimumValue: 5
|
minimumValue: 0
|
||||||
|
maximumValue: 5
|
||||||
realValue: 5
|
realValue: 5
|
||||||
|
realStepSize: 1.0
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
calibrationTimer.interval = realValue * 1000;
|
calibrationTimer.interval = realValue * 1000;
|
||||||
openVrConfiguration.countDown = realValue;
|
openVrConfiguration.countDown = realValue;
|
||||||
numberAnimation.duration = calibrationTimer.interval;
|
numberAnimation.duration = calibrationTimer.interval;
|
||||||
|
openVrConfiguration.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue