Index: sources/gui/qml/components/TickMarks.qml =================================================================== diff -u -rcd7de5f6d239a11615ba8c6c03339a10996486ca -r6cad9b004e904200b71de7431c745795256080df --- sources/gui/qml/components/TickMarks.qml (.../TickMarks.qml) (revision cd7de5f6d239a11615ba8c6c03339a10996486ca) +++ sources/gui/qml/components/TickMarks.qml (.../TickMarks.qml) (revision 6cad9b004e904200b71de7431c745795256080df) @@ -1,14 +1,15 @@ /*! * * 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 + * \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 Slider.qml - * \date 2020/03/13 - * \author Behrouz NematiPour + * \file TickMarks.qml + * \author (last) Behrouz NematiPour + * \date (last) 16-Oct-2020 + * \author (original) Behrouz NematiPour + * \date (original) 22-Mar-2020 * */ @@ -26,32 +27,41 @@ Item { id : _root // if loader used then assign ranges when used. // since loader get the parenthood and it has no range definition. + property int decimal : 0 property int minimum : parent.minimum property int maximum : parent.maximum property int step : parent.step + property bool stepSnap : false property color color : Colors.backgroundDialog property int orientation : Line.Orientation.Vertical property int length : parent.height property int thickness : 1 + property bool textVisible : false + property color textColor : "white" + anchors.fill: parent Repeater { id : _repeater model: (maximum - minimum) / step + 1 Line { id: _line + property int gap : stepSnap ? + ( + (parent.width * (step - (minimum % step))) / (maximum - minimum) + ) : 0 orientation : _root.orientation thickness : _root.thickness color : _root.color length : _root.length - x: (((index * step) * (parent.width - parent.x)) / (maximum - minimum)) + x: (((index * step) * (parent.width - parent.x)) / (maximum - minimum)) + gap y: 0 Text { id : _text visible: textVisible - color: _root.color + color: _root.textColor font.pixelSize: 10 - text: (index * step) + minimum + text: ((index * step) + minimum).toFixed(decimal) anchors { top: parent.bottom topMargin: 5