Index: sources/gui/qml/components/RangeRect.qml =================================================================== diff -u -r732bc047743c99a157cf147f5313194867c1f5e3 -rf1451eae4a4438f4bb336b22374f9e877320fe15 --- sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision 732bc047743c99a157cf147f5313194867c1f5e3) +++ sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision f1451eae4a4438f4bb336b22374f9e877320fe15) @@ -1,20 +1,20 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n - * - * \file RangeRect.qml - * \date 2020/01/24 - * \author Behrouz NematiPour - * + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file RangeRect.qml + * \author (last) Peter Lucia + * \date (last) 06-Oct-2020 + * \author (original) Behrouz NematiPour + * \date (original) 24-Jan-2020 + * */ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 // Project // Qml imports @@ -24,14 +24,22 @@ * \brief Denali project RangeRect */ Rectangle { id: _root - signal clicked() + signal clicked(var vMouseEvent) + signal dragged(var vMouseEvent) + signal released(var vMouseEvent) + signal pressed(var vMouseEvent) - property int minimum : 0 - property int maximum : 0 + property int decimal : 0 + property real minimum : 0 + property real maximum : 0 property alias minText : _textMinimum property alias maxText : _textMaximum + property string unit : "" + + property real touchMargin: 0 + width : parent.width height : parent.height @@ -45,7 +53,7 @@ font.bold : true color : Colors.textProgressBar - text : minimum + text : minimum.toFixed(decimal) + unit anchors { left : parent.left @@ -61,7 +69,7 @@ font.bold : true color : Colors.textProgressBar - text : maximum + text : maximum.toFixed(decimal) + unit anchors { right : parent.right @@ -71,9 +79,20 @@ } MouseArea { id: _mouseArea + anchors.topMargin : -touchMargin + anchors.bottomMargin: -touchMargin anchors.fill: parent + onPositionChanged: { + _root.dragged(mouse) + } onClicked: { - _root.clicked + _root.clicked(mouse) } + onReleased: { + _root.released(mouse) + } + onPressed: { + _root.pressed(mouse) + } } }