mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
SpinBox now works
This commit is contained in:
parent
29a17d366e
commit
1cf82b7725
1 changed files with 33 additions and 20 deletions
|
@ -34,6 +34,15 @@ SpinBox {
|
||||||
property real realTo: 100.0
|
property real realTo: 100.0
|
||||||
property real realStepSize: 1.0
|
property real realStepSize: 1.0
|
||||||
|
|
||||||
|
implicitHeight: height
|
||||||
|
implicitWidth: width
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
leftPadding: 0
|
||||||
|
rightPadding: padding + (up.indicator ? up.indicator.width : 0)
|
||||||
|
topPadding: 0
|
||||||
|
bottomPadding: 0
|
||||||
|
|
||||||
locale: Qt.locale("en_US")
|
locale: Qt.locale("en_US")
|
||||||
|
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
|
@ -46,10 +55,6 @@ SpinBox {
|
||||||
console.warn("rv (value)", realValue)
|
console.warn("rv (value)", realValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
padding: 0
|
|
||||||
leftPadding: 0
|
|
||||||
rightPadding: 0
|
|
||||||
|
|
||||||
stepSize: realStepSize*factor
|
stepSize: realStepSize*factor
|
||||||
value: realValue*factor
|
value: realValue*factor
|
||||||
to : realTo*factor
|
to : realTo*factor
|
||||||
|
@ -86,6 +91,7 @@ SpinBox {
|
||||||
|
|
||||||
|
|
||||||
contentItem: TextInput {
|
contentItem: TextInput {
|
||||||
|
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)
|
||||||
|
@ -97,25 +103,32 @@ SpinBox {
|
||||||
//rightPadding: hifi.dimensions.spinnerSize
|
//rightPadding: hifi.dimensions.spinnerSize
|
||||||
width: spinBox.width - hifi.dimensions.spinnerSize
|
width: spinBox.width - hifi.dimensions.spinnerSize
|
||||||
}
|
}
|
||||||
|
up.indicator: Item {
|
||||||
up.indicator: HiFiGlyphs {
|
x: spinBox.width - implicitWidth - 5
|
||||||
x: spinBox.mirrored ? 0 : spinBox.width - implicitWidth + 10
|
|
||||||
y: 1
|
y: 1
|
||||||
height: parent.height/2
|
clip: true
|
||||||
width: height
|
implicitHeight: spinBox.implicitHeight/2
|
||||||
text: hifi.glyphs.caratUp
|
implicitWidth: spinBox.implicitHeight/2
|
||||||
size: hifi.dimensions.spinnerSize
|
HiFiGlyphs {
|
||||||
color: spinBox.up.pressed || spinBox.up.hovered ? (isLightColorScheme ? hifi.colors.black : hifi.colors.white) : hifi.colors.gray
|
anchors.centerIn: parent
|
||||||
}
|
text: hifi.glyphs.caratUp
|
||||||
|
|
||||||
down.indicator: HiFiGlyphs {
|
|
||||||
x: spinBox.mirrored ? 0 : spinBox.width - implicitWidth + 10
|
|
||||||
height: parent.height/2
|
|
||||||
width: height
|
|
||||||
y: height - 1
|
|
||||||
text: hifi.glyphs.caratDn
|
|
||||||
size: hifi.dimensions.spinnerSize
|
size: hifi.dimensions.spinnerSize
|
||||||
color: spinBox.down.pressed || spinBox.up.hovered ? (isLightColorScheme ? hifi.colors.black : hifi.colors.white) : hifi.colors.gray
|
color: spinBox.down.pressed || spinBox.up.hovered ? (isLightColorScheme ? hifi.colors.black : hifi.colors.white) : hifi.colors.gray
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
down.indicator: Item {
|
||||||
|
x: spinBox.width - implicitWidth - 5
|
||||||
|
y: spinBox.implicitHeight/2
|
||||||
|
clip: true
|
||||||
|
implicitHeight: spinBox.implicitHeight/2
|
||||||
|
implicitWidth: spinBox.implicitHeight/2
|
||||||
|
HiFiGlyphs {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: hifi.glyphs.caratDn
|
||||||
|
size: hifi.dimensions.spinnerSize
|
||||||
|
color: spinBox.down.pressed || spinBox.down.hovered ? (isLightColorScheme ? hifi.colors.black : hifi.colors.white) : hifi.colors.gray
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiControls.Label {
|
HifiControls.Label {
|
||||||
|
|
Loading…
Reference in a new issue