HInteractiveRectangle: add missing pressed effect
This commit is contained in:
parent
7319c8d7b4
commit
1663b166c7
|
@ -3,21 +3,27 @@ import QtQuick 2.12
|
||||||
HRectangle {
|
HRectangle {
|
||||||
property bool checkable: false // TODO
|
property bool checkable: false // TODO
|
||||||
property bool checked: false
|
property bool checked: false
|
||||||
|
property alias pressed: tap.pressed
|
||||||
|
property alias hovered: hover.hovered
|
||||||
|
|
||||||
readonly property QtObject _ir: theme.controls.interactiveRectangle
|
readonly property QtObject _ir: theme.controls.interactiveRectangle
|
||||||
color: _ir.background
|
color: _ir.background
|
||||||
|
|
||||||
HRectangle {
|
HRectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
|
Behavior on opacity { HNumberAnimation { factor: 0.5 } }
|
||||||
|
|
||||||
color: checked ? _ir.checkedOverlay : _ir.hoveredOverlay
|
opacity: pressed ? _ir.pressedOpacity :
|
||||||
|
checked ? _ir.checkedOpacity :
|
||||||
opacity: checked ? _ir.checkedOpacity :
|
hovered ? _ir.hoveredOpacity :
|
||||||
hover.hovered ? _ir.hoveredOpacity :
|
|
||||||
0
|
0
|
||||||
|
|
||||||
Behavior on opacity { HNumberAnimation { factor: 0.66 } }
|
color: pressed ? _ir.pressedOverlay :
|
||||||
|
checked ? _ir.checkedOverlay :
|
||||||
|
hovered ? _ir.hoveredOverlay :
|
||||||
|
"transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler { id: hover }
|
HoverHandler { id: hover }
|
||||||
|
|
|
@ -95,13 +95,13 @@ controls:
|
||||||
interactiveRectangle:
|
interactiveRectangle:
|
||||||
color background: "transparent"
|
color background: "transparent"
|
||||||
|
|
||||||
color hoveredOverlay: hsluv(0, 0, 80)
|
color hoveredOverlay: hsluv(0, 0, 100)
|
||||||
color pressedOverlay: hsluv(0, 0, 80)
|
color pressedOverlay: hsluv(0, 0, 100)
|
||||||
color checkedOverlay: hsluv(0, 0, 80)
|
color checkedOverlay: hsluv(0, 0, 100)
|
||||||
|
|
||||||
real hoveredOpacity: 0.1
|
real hoveredOpacity: 0.1
|
||||||
real pressedOpacity: 0.2
|
real pressedOpacity: 0.2
|
||||||
real checkedOpacity: 0.1
|
real checkedOpacity: 0.08
|
||||||
|
|
||||||
textField:
|
textField:
|
||||||
color background: colors.inputBackground
|
color background: colors.inputBackground
|
||||||
|
|
Loading…
Reference in New Issue
Block a user