Add page to change desktop overlay translation
The implementation is simple 3D vector scaling and addition. The HmdMatrix34_t consists of a 3x3 rotation matrix and a 3D vector for position. The overlay position is only updated whenever a new overlay is changed because we need the old overlay position in order to modify it. The openvr call to get the position is only updated whenever you open the menu. A new page was created due to lack of space on the utilities page.
This commit is contained in:
@@ -114,6 +114,17 @@ MyStackViewPage {
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: desktopOverlayButton
|
||||
activationSoundEnabled: false
|
||||
text: "Desktop Overlay"
|
||||
Layout.fillWidth: true
|
||||
onClicked: {
|
||||
MyResources.playFocusChangedSound()
|
||||
mainView.push(desktopOverlayPage)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: statisticsButton
|
||||
activationSoundEnabled: false
|
||||
|
||||
@@ -5,6 +5,7 @@ import ".."
|
||||
import "../utilities_page"
|
||||
import "../audio_page"
|
||||
import "../motion_page"
|
||||
import "../desktop_overlay_page"
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
@@ -71,6 +72,11 @@ Rectangle {
|
||||
visible: false
|
||||
}
|
||||
|
||||
property DesktopOverlayPage desktopOverlayPage: DesktopOverlayPage {
|
||||
stackView: mainView
|
||||
visible: false
|
||||
}
|
||||
|
||||
StackView {
|
||||
id: mainView
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "translation_left_right"
|
||||
import "translation_back_forwards"
|
||||
import "translation_up_down"
|
||||
import "desktop_size"
|
||||
import "../common"
|
||||
|
||||
MyStackViewPage {
|
||||
headerText: "Desktop Overlay"
|
||||
|
||||
content: ColumnLayout {
|
||||
spacing: 18
|
||||
|
||||
SteamDesktopGroupBox {
|
||||
}
|
||||
|
||||
SteamDesktopTranslationUpDown {
|
||||
}
|
||||
|
||||
SteamDesktopTranslationBackForwards {
|
||||
}
|
||||
|
||||
SteamDesktopTranslationLeftRight {
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -7,7 +7,7 @@ import "../../common"
|
||||
GroupBox {
|
||||
id: steamDesktopGroupBox
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Steam Desktop Overlay Width"
|
||||
@@ -20,14 +20,14 @@ GroupBox {
|
||||
}
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
|
||||
Rectangle {
|
||||
color: "#ffffff"
|
||||
height: 1
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: 5
|
||||
}
|
||||
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
MyPushButton2 {
|
||||
@@ -38,7 +38,7 @@ GroupBox {
|
||||
steamDesktopWidthSlider.value -= 1.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MySlider {
|
||||
id: steamDesktopWidthSlider
|
||||
from: 0.1
|
||||
@@ -55,7 +55,7 @@ GroupBox {
|
||||
steamDesktopWidthText.text = value.toFixed(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MyPushButton2 {
|
||||
id: steamDesktopWidthPlusButton
|
||||
Layout.preferredWidth: 40
|
||||
@@ -64,7 +64,7 @@ GroupBox {
|
||||
steamDesktopWidthSlider.value += 1.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MyTextField {
|
||||
id: steamDesktopWidthText
|
||||
text: "0.0"
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
id: steamDesktopGroupBox
|
||||
Layout.fillWidth: true
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Backwards/Forwards Translation"
|
||||
bottomPadding: -10
|
||||
}
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "#ffffff"
|
||||
radius: 8
|
||||
}
|
||||
property real sliderStepSize: 0.10
|
||||
property real rightLeftLimit: 4.0
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
LineSeparator {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
MyPushButton2 {
|
||||
Layout.preferredWidth: 40
|
||||
text: "-"
|
||||
onClicked: {
|
||||
steamDesktopForwardSlider.value -= sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MySlider {
|
||||
id: steamDesktopForwardSlider
|
||||
from: -rightLeftLimit
|
||||
to: rightLeftLimit
|
||||
stepSize: sliderStepSize
|
||||
value: 0.0
|
||||
Layout.fillWidth: true
|
||||
onValueChanged: {
|
||||
DesktopOverlay.forwardsMovement = this.value
|
||||
steamDesktopForwardText.text = this.value.toFixed(2)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
Layout.preferredWidth: 40
|
||||
text: "+"
|
||||
onClicked: {
|
||||
steamDesktopForwardSlider.value += sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MyTextField {
|
||||
id: steamDesktopForwardText
|
||||
text: "0.0"
|
||||
keyBoardUID: 611
|
||||
Layout.preferredWidth: 100
|
||||
Layout.leftMargin: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
onAcceptableInputChanged: {
|
||||
steamDesktopForwardSlider.value = this.value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
steamDesktopForwardSlider.value = DesktopOverlay.forwardsMovement
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
id: steamDesktopGroupBox
|
||||
Layout.fillWidth: true
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Left/Right Translation"
|
||||
bottomPadding: -10
|
||||
}
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "#ffffff"
|
||||
radius: 8
|
||||
}
|
||||
property real sliderStepSize: 0.10
|
||||
property real rightLeftLimit: 4.0
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
LineSeparator {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
MyPushButton2 {
|
||||
id: steamDesktopWidthMinusButton
|
||||
Layout.preferredWidth: 40
|
||||
text: "-"
|
||||
onClicked: {
|
||||
steamDesktopWidthSlider.value -= sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MySlider {
|
||||
id: steamDesktopWidthSlider
|
||||
from: -rightLeftLimit
|
||||
to: rightLeftLimit
|
||||
stepSize: sliderStepSize
|
||||
value: 0.0
|
||||
Layout.fillWidth: true
|
||||
onValueChanged: {
|
||||
DesktopOverlay.rightMovement = this.value
|
||||
steamDesktopWidthText.text = this.value.toFixed(2)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
id: steamDesktopWidthPlusButton
|
||||
Layout.preferredWidth: 40
|
||||
text: "+"
|
||||
onClicked: {
|
||||
steamDesktopWidthSlider.value += sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MyTextField {
|
||||
id: steamDesktopWidthText
|
||||
text: "0.0"
|
||||
keyBoardUID: 611
|
||||
Layout.preferredWidth: 100
|
||||
Layout.leftMargin: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
onAcceptableInputChanged: {
|
||||
steamDesktopWidthSlider.value = this.value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
steamDesktopWidthSlider.value = DesktopOverlay.rightMovement
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
id: steamDesktopGroupBox
|
||||
Layout.fillWidth: true
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Up/Down Translation"
|
||||
bottomPadding: -10
|
||||
}
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "#ffffff"
|
||||
radius: 8
|
||||
}
|
||||
property real sliderStepSize: 0.10
|
||||
property real rightLeftLimit: 4.0
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
LineSeparator {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
MyPushButton2 {
|
||||
Layout.preferredWidth: 40
|
||||
text: "-"
|
||||
onClicked: {
|
||||
steamDesktopUpSlider.value -= sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MySlider {
|
||||
id: steamDesktopUpSlider
|
||||
from: -rightLeftLimit
|
||||
to: rightLeftLimit
|
||||
stepSize: sliderStepSize
|
||||
value: 0.0
|
||||
Layout.fillWidth: true
|
||||
onValueChanged: {
|
||||
DesktopOverlay.height = this.value
|
||||
steamDesktopUpText.text = this.value.toFixed(2)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
Layout.preferredWidth: 40
|
||||
text: "+"
|
||||
onClicked: {
|
||||
steamDesktopUpSlider.value += sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MyTextField {
|
||||
id: steamDesktopUpText
|
||||
text: "0.0"
|
||||
keyBoardUID: 611
|
||||
Layout.preferredWidth: 100
|
||||
Layout.leftMargin: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
onAcceptableInputChanged: {
|
||||
steamDesktopUpSlider.value = this.value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
steamDesktopUpSlider.value = DesktopOverlay.height
|
||||
}
|
||||
}
|
||||
@@ -22,10 +22,6 @@ MyStackViewPage {
|
||||
id: alarmGroupBox
|
||||
}
|
||||
|
||||
SteamDesktopGroupBox {
|
||||
id: steamDesktopGroupBox
|
||||
}
|
||||
|
||||
MediaControllerKeys {
|
||||
id: mediaKeysGroupBox
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user