diff --git a/src/openvr/overlay_utils.cpp b/src/openvr/overlay_utils.cpp index 6f563ee..d70ec0d 100644 --- a/src/openvr/overlay_utils.cpp +++ b/src/openvr/overlay_utils.cpp @@ -72,6 +72,9 @@ overlay::DesktopOverlay::DesktopOverlay() m_rightMovement = settings.value( strings::rightMovementSettingsName, defaultMovement ) .toDouble(); + m_upMovement + = settings.value( strings::upMovementSettingsName, defaultMovement ) + .toDouble(); settings.endGroup(); } diff --git a/src/openvr/overlay_utils.h b/src/openvr/overlay_utils.h index 22875a9..e882b53 100644 --- a/src/openvr/overlay_utils.h +++ b/src/openvr/overlay_utils.h @@ -24,6 +24,7 @@ namespace strings constexpr auto defaultOverlayWidth = 4.0; constexpr auto defaultMovement = 0.0; +constexpr auto defaultWidth = 1.0; class DesktopOverlay : public QObject { diff --git a/src/res/qml/desktop_overlay_page/desktop_size/SteamDesktopGroupBox.qml b/src/res/qml/desktop_overlay_page/desktop_size/SteamDesktopGroupBox.qml index 0bdf3ea..f5321ed 100644 --- a/src/res/qml/desktop_overlay_page/desktop_size/SteamDesktopGroupBox.qml +++ b/src/res/qml/desktop_overlay_page/desktop_size/SteamDesktopGroupBox.qml @@ -5,7 +5,6 @@ import ovras.advsettings 1.0 import "../../common" GroupBox { - id: steamDesktopGroupBox Layout.fillWidth: true label: MyText { @@ -18,24 +17,23 @@ GroupBox { border.color: "#ffffff" radius: 8 } + + property real sliderStepSize: 1.0 + property real sliderStartingValue: 1.0 + ColumnLayout { anchors.fill: parent - Rectangle { - color: "#ffffff" - height: 1 - Layout.fillWidth: true - Layout.bottomMargin: 5 + LineSeparator { } ColumnLayout { RowLayout { MyPushButton2 { - id: steamDesktopWidthMinusButton Layout.preferredWidth: 40 text: "-" onClicked: { - steamDesktopWidthSlider.value -= 1.0 + steamDesktopWidthSlider.value -= sliderStepSize } } @@ -44,24 +42,22 @@ GroupBox { from: 0.1 to: 32.0 stepSize: 0.1 - value: 1.0 + value: sliderStartingValue Layout.fillWidth: true onPositionChanged: { - var val = this.from + ( this.position * (this.to - this.from)) - steamDesktopWidthText.text = val.toFixed(1) + // } onValueChanged: { - UtilitiesTabController.setSteamDesktopOverlayWidth(value, false) - steamDesktopWidthText.text = value.toFixed(1) + DesktopOverlay.width = this.value + steamDesktopWidthText.text = this.value.toFixed(2) } } MyPushButton2 { - id: steamDesktopWidthPlusButton Layout.preferredWidth: 40 text: "+" onClicked: { - steamDesktopWidthSlider.value += 1.0 + steamDesktopWidthSlider.value += sliderStepSize } } @@ -79,30 +75,13 @@ GroupBox { val = 0.1 } steamDesktopWidthSlider.value = val - UtilitiesTabController.setSteamDesktopOverlayWidth(val, false) } - text = UtilitiesTabController.steamDesktopOverlayWidth.toFixed(1) } } } } } Component.onCompleted: { - steamDesktopGroupBox.visible = UtilitiesTabController.steamDesktopOverlayAvailable - if (steamDesktopGroupBox.visible) { - steamDesktopWidthSlider.value = UtilitiesTabController.steamDesktopOverlayWidth - } - } - Connections { - target: UtilitiesTabController - onSteamDesktopOverlayAvailableChanged: { - steamDesktopGroupBox.visible = UtilitiesTabController.steamDesktopOverlayAvailable - if (steamDesktopGroupBox.visible) { - steamDesktopWidthSlider.value = UtilitiesTabController.steamDesktopOverlayWidth - } - } - onSteamDesktopOverlayWidthChanged: { - steamDesktopWidthSlider.value = UtilitiesTabController.steamDesktopOverlayWidth - } + steamDesktopWidthSlider.value = DesktopOverlay.width } } diff --git a/src/res/qml/desktop_overlay_page/translation_back_forwards/SteamDesktopTranslationBackForwards.qml b/src/res/qml/desktop_overlay_page/translation_back_forwards/SteamDesktopTranslationBackForwards.qml index 6596567..c3f7ddd 100644 --- a/src/res/qml/desktop_overlay_page/translation_back_forwards/SteamDesktopTranslationBackForwards.qml +++ b/src/res/qml/desktop_overlay_page/translation_back_forwards/SteamDesktopTranslationBackForwards.qml @@ -5,7 +5,6 @@ import ovras.advsettings 1.0 import "../../common" GroupBox { - id: steamDesktopGroupBox Layout.fillWidth: true label: MyText { diff --git a/src/res/qml/desktop_overlay_page/translation_left_right/SteamDesktopTranslationLeftRight.qml b/src/res/qml/desktop_overlay_page/translation_left_right/SteamDesktopTranslationLeftRight.qml index 5b523bc..8d4d865 100644 --- a/src/res/qml/desktop_overlay_page/translation_left_right/SteamDesktopTranslationLeftRight.qml +++ b/src/res/qml/desktop_overlay_page/translation_left_right/SteamDesktopTranslationLeftRight.qml @@ -5,7 +5,6 @@ import ovras.advsettings 1.0 import "../../common" GroupBox { - id: steamDesktopGroupBox Layout.fillWidth: true label: MyText { @@ -30,16 +29,15 @@ GroupBox { ColumnLayout { RowLayout { MyPushButton2 { - id: steamDesktopWidthMinusButton Layout.preferredWidth: 40 text: "-" onClicked: { - steamDesktopWidthSlider.value -= sliderStepSize + steamDesktopRightSlider.value -= sliderStepSize } } MySlider { - id: steamDesktopWidthSlider + id: steamDesktopRightSlider from: -rightLeftLimit to: rightLeftLimit stepSize: sliderStepSize @@ -47,34 +45,33 @@ GroupBox { Layout.fillWidth: true onValueChanged: { DesktopOverlay.rightMovement = this.value - steamDesktopWidthText.text = this.value.toFixed(2) + steamDesktopRightText.text = this.value.toFixed(2) } } MyPushButton2 { - id: steamDesktopWidthPlusButton Layout.preferredWidth: 40 text: "+" onClicked: { - steamDesktopWidthSlider.value += sliderStepSize + steamDesktopRightSlider.value += sliderStepSize } } MyTextField { - id: steamDesktopWidthText + id: steamDesktopRightText text: "0.0" keyBoardUID: 611 Layout.preferredWidth: 100 Layout.leftMargin: 10 horizontalAlignment: Text.AlignHCenter onAcceptableInputChanged: { - steamDesktopWidthSlider.value = this.value + steamDesktopRightSlider.value = this.value } } } } } Component.onCompleted: { - steamDesktopWidthSlider.value = DesktopOverlay.rightMovement + steamDesktopRightSlider.value = DesktopOverlay.rightMovement } } diff --git a/src/res/qml/desktop_overlay_page/translation_up_down/SteamDesktopTranslationUpDown.qml b/src/res/qml/desktop_overlay_page/translation_up_down/SteamDesktopTranslationUpDown.qml index 91b3488..7b56435 100644 --- a/src/res/qml/desktop_overlay_page/translation_up_down/SteamDesktopTranslationUpDown.qml +++ b/src/res/qml/desktop_overlay_page/translation_up_down/SteamDesktopTranslationUpDown.qml @@ -5,7 +5,6 @@ import ovras.advsettings 1.0 import "../../common" GroupBox { - id: steamDesktopGroupBox Layout.fillWidth: true label: MyText { diff --git a/src/res/qml/utilities_page/UtilitiesPage.qml b/src/res/qml/utilities_page/UtilitiesPage.qml index 2945d68..bce8d48 100644 --- a/src/res/qml/utilities_page/UtilitiesPage.qml +++ b/src/res/qml/utilities_page/UtilitiesPage.qml @@ -4,7 +4,6 @@ import QtQuick.Layouts 1.3 import ovras.advsettings 1.0 import "media_keys" import "alarm_clock" -import "desktop_size" import "keyboard_utils" import "../common"