Fix incorrect behavior in QML
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
|
||||
GroupBox {
|
||||
// Public properties
|
||||
// Overload
|
||||
property alias headerMessage: headerText.text
|
||||
property alias sliderText: steamDesktopForwardText.text
|
||||
property alias sliderValue: steamDesktopForwardSlider.value
|
||||
property alias lowerLimit: steamDesktopForwardSlider.from
|
||||
property alias upperLimit: steamDesktopForwardSlider.to
|
||||
|
||||
|
||||
function onValueChanged(value) {
|
||||
|
||||
}
|
||||
|
||||
function onComponentComplete() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Private properties
|
||||
id: sliderBox
|
||||
Layout.fillWidth: true
|
||||
label: MyText {
|
||||
id: headerText
|
||||
leftPadding: 10
|
||||
text: "MISSING HEADER TEXT"
|
||||
bottomPadding: -10
|
||||
}
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "#ffffff"
|
||||
radius: 8
|
||||
}
|
||||
|
||||
property real sliderStepSize: 0.10
|
||||
readonly 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
|
||||
Layout.fillWidth: true
|
||||
onValueChanged: {
|
||||
sliderBox.onValueChanged(this.value)
|
||||
}
|
||||
}
|
||||
|
||||
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: {
|
||||
sliderBox.onComponentComplete()
|
||||
}
|
||||
}
|
||||
@@ -4,84 +4,19 @@ import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
Layout.fillWidth: true
|
||||
FullWidthSliderBox {
|
||||
headerMessage: "Overlay Width"
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Steam Desktop Overlay Width"
|
||||
bottomPadding: -10
|
||||
lowerLimit: 0.0
|
||||
upperLimit: 32.0
|
||||
sliderStepSize: 0.5
|
||||
|
||||
function onValueChanged(value) {
|
||||
DesktopOverlay.width = value
|
||||
sliderText = value.toFixed(2)
|
||||
}
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "#ffffff"
|
||||
radius: 8
|
||||
}
|
||||
|
||||
property real sliderStepSize: 1.0
|
||||
property real sliderStartingValue: 1.0
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
LineSeparator {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
MyPushButton2 {
|
||||
Layout.preferredWidth: 40
|
||||
text: "-"
|
||||
onClicked: {
|
||||
steamDesktopWidthSlider.value -= sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MySlider {
|
||||
id: steamDesktopWidthSlider
|
||||
from: 0.1
|
||||
to: 32.0
|
||||
stepSize: 0.1
|
||||
value: sliderStartingValue
|
||||
Layout.fillWidth: true
|
||||
onPositionChanged: {
|
||||
//
|
||||
}
|
||||
onValueChanged: {
|
||||
DesktopOverlay.width = this.value
|
||||
steamDesktopWidthText.text = this.value.toFixed(2)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
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
|
||||
function onInputEvent(input) {
|
||||
var val = parseFloat(input)
|
||||
if (!isNaN(val)) {
|
||||
if (val < 0.1) {
|
||||
val = 0.1
|
||||
}
|
||||
steamDesktopWidthSlider.value = val
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
steamDesktopWidthSlider.value = DesktopOverlay.width
|
||||
function onComponentComplete() {
|
||||
sliderValue = DesktopOverlay.width
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-67
@@ -4,74 +4,18 @@ import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
Layout.fillWidth: true
|
||||
FullWidthSliderBox {
|
||||
headerMessage: "Forwards/Backwards Translation"
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Backwards/Forwards Translation"
|
||||
bottomPadding: -10
|
||||
lowerLimit: -4.0
|
||||
upperLimit: 4.0
|
||||
sliderStepSize: 0.10
|
||||
|
||||
function onValueChanged(value) {
|
||||
DesktopOverlay.forwardsMovement = value
|
||||
sliderText = value.toFixed(2)
|
||||
}
|
||||
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
|
||||
function onComponentComplete() {
|
||||
sliderValue = DesktopOverlay.forwardsMovement
|
||||
}
|
||||
}
|
||||
|
||||
+11
-67
@@ -4,74 +4,18 @@ import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
Layout.fillWidth: true
|
||||
FullWidthSliderBox {
|
||||
headerMessage: "Left/Right Translation"
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Left/Right Translation"
|
||||
bottomPadding: -10
|
||||
lowerLimit: -4.0
|
||||
upperLimit: 4.0
|
||||
sliderStepSize: 0.10
|
||||
|
||||
function onValueChanged(value) {
|
||||
DesktopOverlay.rightMovement = value
|
||||
sliderText = value.toFixed(2)
|
||||
}
|
||||
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: {
|
||||
steamDesktopRightSlider.value -= sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MySlider {
|
||||
id: steamDesktopRightSlider
|
||||
from: -rightLeftLimit
|
||||
to: rightLeftLimit
|
||||
stepSize: sliderStepSize
|
||||
value: 0.0
|
||||
Layout.fillWidth: true
|
||||
onValueChanged: {
|
||||
DesktopOverlay.rightMovement = this.value
|
||||
steamDesktopRightText.text = this.value.toFixed(2)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
Layout.preferredWidth: 40
|
||||
text: "+"
|
||||
onClicked: {
|
||||
steamDesktopRightSlider.value += sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MyTextField {
|
||||
id: steamDesktopRightText
|
||||
text: "0.0"
|
||||
keyBoardUID: 611
|
||||
Layout.preferredWidth: 100
|
||||
Layout.leftMargin: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
onAcceptableInputChanged: {
|
||||
steamDesktopRightSlider.value = this.value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
steamDesktopRightSlider.value = DesktopOverlay.rightMovement
|
||||
function onComponentComplete() {
|
||||
sliderValue = DesktopOverlay.rightMovement
|
||||
}
|
||||
}
|
||||
|
||||
+11
-67
@@ -4,74 +4,18 @@ import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
Layout.fillWidth: true
|
||||
FullWidthSliderBox {
|
||||
headerMessage: "Up/Down Translation"
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Up/Down Translation"
|
||||
bottomPadding: -10
|
||||
lowerLimit: -4.0
|
||||
upperLimit: 4.0
|
||||
sliderStepSize: 0.10
|
||||
|
||||
function onValueChanged(value) {
|
||||
DesktopOverlay.height = value
|
||||
sliderText = value.toFixed(2)
|
||||
}
|
||||
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
|
||||
function onComponentComplete() {
|
||||
sliderValue = DesktopOverlay.height
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user