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