mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 13:49:23 +02:00
UIT RadioButton
This commit is contained in:
parent
51cbadcad1
commit
feb5021372
2 changed files with 41 additions and 41 deletions
|
@ -22,13 +22,25 @@ QtObject {
|
||||||
|
|
||||||
readonly property QtObject controls: QtObject {
|
readonly property QtObject controls: QtObject {
|
||||||
readonly property QtObject radioButton: QtObject {
|
readonly property QtObject radioButton: QtObject {
|
||||||
readonly property QtObject checked: QtObject {
|
readonly property QtObject background: QtObject {
|
||||||
readonly property color startColor: "#7d7d7d"
|
readonly property color startColor: "#828282"
|
||||||
readonly property color checkboxFinish: "#6b6a6b"
|
readonly property real startPosition: 0.15
|
||||||
|
readonly property color endColor: "#6A6A6A"
|
||||||
|
readonly property real endPosition: 1.0
|
||||||
|
readonly property real disabledOpacity: 0.5
|
||||||
}
|
}
|
||||||
readonly property QtObject unchecked: QtObject {
|
readonly property QtObject hover: QtObject {
|
||||||
readonly property color startColor: "#7d7d7d"
|
readonly property color outerBorderColor: "#00B4EF"
|
||||||
readonly property color checkboxFinish: "#6b6a6b"
|
readonly property color innerColor: "#00B4EF"
|
||||||
|
readonly property color innerBorderColor: "#36CDFF"
|
||||||
|
readonly property real innerOpacity: 0.5
|
||||||
|
}
|
||||||
|
readonly property QtObject active: QtObject {
|
||||||
|
readonly property color color: "#00B4EF"
|
||||||
|
}
|
||||||
|
readonly property QtObject checked: QtObject {
|
||||||
|
readonly property color innerColor: "#00B4EF"
|
||||||
|
readonly property color innerBorderColor: "#36CDFF"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
readonly property QtObject slider: QtObject {
|
readonly property QtObject slider: QtObject {
|
||||||
|
@ -151,6 +163,10 @@ QtObject {
|
||||||
readonly property int labelTextSize: 14
|
readonly property int labelTextSize: 14
|
||||||
readonly property int backgroundHeight: 8
|
readonly property int backgroundHeight: 8
|
||||||
}
|
}
|
||||||
|
readonly property QtObject radioButton: QtObject {
|
||||||
|
readonly property int outerBorderWidth: 1
|
||||||
|
readonly property int innerBorderWidth: 1
|
||||||
|
}
|
||||||
readonly property QtObject simplifiedSwitch: QtObject {
|
readonly property QtObject simplifiedSwitch: QtObject {
|
||||||
readonly property int switchBackgroundHeight: 18
|
readonly property int switchBackgroundHeight: 18
|
||||||
readonly property int switchBackgroundWidth: 47
|
readonly property int switchBackgroundWidth: 47
|
||||||
|
|
|
@ -46,58 +46,42 @@ RadioButton {
|
||||||
implicitHeight: root.radioButtonRadius
|
implicitHeight: root.radioButtonRadius
|
||||||
radius: root.radioButtonRadius
|
radius: root.radioButtonRadius
|
||||||
y: parent.height / 2 - height / 2
|
y: parent.height / 2 - height / 2
|
||||||
border.width: 1
|
border.width: root.hovered ? simplifiedUI.sizes.controls.radioButton.outerBorderWidth : 0
|
||||||
border.color: pressed || hovered
|
border.color: simplifiedUI.colors.controls.radioButton.hover.outerBorderColor
|
||||||
? hifi.colors.checkboxCheckedBorder
|
opacity: root.disabled ? 0.5 : 1.0
|
||||||
: hifi.colors.checkboxDarkFinish
|
|
||||||
|
|
||||||
gradient: Gradient {
|
gradient: Gradient {
|
||||||
GradientStop {
|
GradientStop {
|
||||||
position: 0.2
|
position: simplifiedUI.colors.controls.radioButton.background.startPosition
|
||||||
color: pressed || hovered
|
color: simplifiedUI.colors.controls.radioButton.background.startColor
|
||||||
? hifi.colors.checkboxLightStart
|
|
||||||
: hifi.colors.checkboxDarkStart
|
|
||||||
}
|
}
|
||||||
GradientStop {
|
GradientStop {
|
||||||
position: 1.0
|
position: simplifiedUI.colors.controls.radioButton.background.endPosition
|
||||||
color: pressed || hovered
|
color: simplifiedUI.colors.controls.radioButton.background.endColor
|
||||||
? hifi.colors.checkboxLightFinish
|
|
||||||
: hifi.colors.checkboxDarkFinish
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: innerBox
|
id: innerBox
|
||||||
visible: pressed || hovered
|
visible: root.checked || root.hovered
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: checkSize - 4
|
width: root.checkSize
|
||||||
height: width
|
height: width
|
||||||
radius: checkSize / 2
|
radius: checkSize / 2
|
||||||
color: hifi.colors.checkboxCheckedBorder
|
border.width: simplifiedUI.sizes.controls.radioButton.innerBorderWidth
|
||||||
|
border.color: root.hovered ? simplifiedUI.colors.controls.radioButton.hover.innerBorderColor : simplifiedUI.colors.controls.radioButton.checked.innerBorderColor
|
||||||
|
color: root.hovered ? simplifiedUI.colors.controls.radioButton.hover.innerColor : simplifiedUI.colors.controls.radioButton.hover.innerColor
|
||||||
|
opacity: root.hovered ? simplifiedUI.colors.controls.radioButton.hover.innerOpacity : 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: check
|
id: pressedBox
|
||||||
width: checkSize
|
visible: root.pressed
|
||||||
height: checkSize
|
width: parent.width
|
||||||
radius: checkSize / 2
|
height: parent.height
|
||||||
|
radius: parent.radius
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: hifi.colors.checkboxChecked
|
color: simplifiedUI.colors.controls.radioButton.active.color
|
||||||
border.width: 2
|
|
||||||
border.color: hifi.colors.checkboxCheckedBorder
|
|
||||||
visible: checked && !pressed || !checked && pressed
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: disabledOverlay
|
|
||||||
visible: !enabled
|
|
||||||
width: root.radioButtonRadius
|
|
||||||
height: root.radioButtonRadius
|
|
||||||
radius: root.radioButtonRadius / 2
|
|
||||||
border.width: 1
|
|
||||||
border.color: hifi.colors.baseGrayHighlight
|
|
||||||
color: hifi.colors.baseGrayHighlight
|
|
||||||
opacity: 0.5
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue