Index: sources/gui/qml/components/TouchRect.qml =================================================================== diff -u -r44a85c96ab55e424866ec4cca0270aa218355f82 -r305d411b4bc617d858075f5750dea487d707bebb --- sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) +++ sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 305d411b4bc617d858075f5750dea487d707bebb) @@ -33,6 +33,8 @@ property int duration : 200 property bool disabled : false + property bool selectable : false + property bool selected : false property color textColor : Colors.textButton property color borderColor : Colors.borderButton @@ -82,10 +84,26 @@ color: textColor font.pixelSize: Fonts.fontPixelButton } + + function setSelected(isSelected) { + _root.selected = isSelected + if (_root.selected) { + _root.color = Colors.backgroundBtnSelectDark + } + else { + _root.color = backgroundColor + } + } + MouseArea { id: _mouseArea anchors.fill: parent onClicked : { if ( disabled ) { return } + if (selectable) { + setSelected(!selected) + _root.clicked() + return + } animate(true) _root.clicked() }