2019-07-13 07:06:37 +10:00
|
|
|
// Copyright 2019 miruka
|
|
|
|
// This file is part of harmonyqml, licensed under LGPLv3.
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
|
|
|
|
HRectangle {
|
|
|
|
property bool checkable: false // TODO
|
|
|
|
property bool checked: false
|
|
|
|
|
2019-07-18 15:56:58 +10:00
|
|
|
readonly property QtObject _ir: theme.controls.interactiveRectangle
|
|
|
|
|
|
|
|
property color normalColor: _ir.background
|
|
|
|
property color hoveredColor: _ir.hoveredBackground
|
|
|
|
property color pressedColor: _ir.pressedBackground
|
|
|
|
property color checkedColor: _ir.checkedBackground
|
2019-07-13 07:06:37 +10:00
|
|
|
|
|
|
|
color: checked ? checkedColor :
|
|
|
|
// tap.pressed ? pressedColor :
|
|
|
|
hover.hovered ? hoveredColor :
|
|
|
|
normalColor
|
|
|
|
|
2019-07-18 15:53:28 +10:00
|
|
|
Behavior on color { HColorAnimation { factor: 0.66 } }
|
2019-07-13 07:06:37 +10:00
|
|
|
|
|
|
|
HoverHandler { id: hover }
|
|
|
|
TapHandler { id: tap }
|
|
|
|
}
|