mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 19:53:29 +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
interface/resources/qml
|
@ -83,8 +83,10 @@ SpinBox {
|
|||
}
|
||||
|
||||
validator: DoubleValidator {
|
||||
bottom: Math.min(spinBox.from, spinBox.to)
|
||||
top: Math.max(spinBox.from, spinBox.to)
|
||||
decimals: spinBox.decimals
|
||||
bottom: Math.min(spinBox.realFrom, spinBox.realTo)
|
||||
top: Math.max(spinBox.realFrom, spinBox.realTo)
|
||||
notation: DoubleValidator.StandardNotation
|
||||
}
|
||||
|
||||
textFromValue: function(value, locale) {
|
||||
|
@ -97,20 +99,37 @@ SpinBox {
|
|||
|
||||
|
||||
contentItem: TextInput {
|
||||
id: spinboxText
|
||||
z: 2
|
||||
color: isLightColorScheme
|
||||
? (spinBox.activeFocus ? hifi.colors.black : hifi.colors.lightGray)
|
||||
: (spinBox.activeFocus ? hifi.colors.white : hifi.colors.lightGrayText)
|
||||
selectedTextColor: hifi.colors.black
|
||||
selectionColor: hifi.colors.primaryHighlight
|
||||
text: spinBox.textFromValue(spinBox.value, spinBox.locale) + suffix
|
||||
text: spinBox.textFromValue(spinBox.value, spinBox.locale)
|
||||
inputMethodHints: spinBox.inputMethodHints
|
||||
validator: spinBox.validator
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
leftPadding: spinBoxLabelInside.visible ? 30 : hifi.dimensions.textPadding
|
||||
//rightPadding: hifi.dimensions.spinnerSize
|
||||
width: spinBox.width - hifi.dimensions.spinnerSize
|
||||
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 {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Window 2.2
|
||||
import QtGraphicalEffects 1.0
|
||||
import Qt.labs.settings 1.0
|
||||
import stylesUit 1.0
|
||||
|
@ -72,6 +73,11 @@ Item {
|
|||
initialItem: inputConfiguration
|
||||
property alias messageVisible: imageMessageBox.visible
|
||||
property string selectedPlugin: ""
|
||||
|
||||
property bool keyboardEnabled: false
|
||||
property bool keyboardRaised: false
|
||||
property bool punctuationMode: false
|
||||
|
||||
Rectangle {
|
||||
id: inputConfiguration
|
||||
anchors {
|
||||
|
@ -227,6 +233,8 @@ Item {
|
|||
anchors.right: parent.right
|
||||
anchors.top: inputConfiguration.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: keyboard.height
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
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() {
|
||||
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: {
|
||||
page = config.createObject(flick.contentItem);
|
||||
}
|
||||
|
@ -39,6 +51,8 @@ Flickable {
|
|||
id: config
|
||||
Rectangle {
|
||||
id: openVrConfiguration
|
||||
anchors.fill: parent
|
||||
|
||||
property int leftMargin: 75
|
||||
property int countDown: 0
|
||||
property string pluginName: ""
|
||||
|
@ -200,6 +214,7 @@ Flickable {
|
|||
|
||||
onEditingFinished: {
|
||||
sendConfigurationSettings();
|
||||
openVrConfiguration.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -217,6 +232,7 @@ Flickable {
|
|||
|
||||
onEditingFinished: {
|
||||
sendConfigurationSettings();
|
||||
openVrConfiguration.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -309,6 +325,7 @@ Flickable {
|
|||
|
||||
onEditingFinished: {
|
||||
sendConfigurationSettings();
|
||||
openVrConfiguration.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -325,6 +342,7 @@ Flickable {
|
|||
|
||||
onEditingFinished: {
|
||||
sendConfigurationSettings();
|
||||
openVrConfiguration.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -550,13 +568,15 @@ Flickable {
|
|||
width: 160
|
||||
suffix: " cm"
|
||||
label: "Arm Circumference"
|
||||
minimumValue: 0
|
||||
minimumValue: 10.0
|
||||
maximumValue: 50.0
|
||||
realStepSize: 1.0
|
||||
colorScheme: hifi.colorSchemes.dark
|
||||
realValue: 33.0
|
||||
|
||||
onEditingFinished: {
|
||||
sendConfigurationSettings();
|
||||
openVrConfiguration.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -565,7 +585,8 @@ Flickable {
|
|||
width: 160
|
||||
label: "Shoulder Width"
|
||||
suffix: " cm"
|
||||
minimumValue: 0
|
||||
minimumValue: 25.0
|
||||
maximumValue: 50.0
|
||||
realStepSize: 1.0
|
||||
decimals: 1
|
||||
colorScheme: hifi.colorSchemes.dark
|
||||
|
@ -573,6 +594,7 @@ Flickable {
|
|||
|
||||
onEditingFinished: {
|
||||
sendConfigurationSettings();
|
||||
openVrConfiguration.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -743,14 +765,17 @@ Flickable {
|
|||
anchors.left: parent.left
|
||||
anchors.leftMargin: leftMargin
|
||||
|
||||
minimumValue: 5
|
||||
minimumValue: 0
|
||||
maximumValue: 5
|
||||
realValue: 5
|
||||
realStepSize: 1.0
|
||||
colorScheme: hifi.colorSchemes.dark
|
||||
|
||||
onEditingFinished: {
|
||||
calibrationTimer.interval = realValue * 1000;
|
||||
openVrConfiguration.countDown = realValue;
|
||||
numberAnimation.duration = calibrationTimer.interval;
|
||||
openVrConfiguration.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue