Index: sources/gui/qml/components/TimeText.qml =================================================================== diff -u -rd364178ab42a711fa1e0a41f05c61aa4b4489de0 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/components/TimeText.qml (.../TimeText.qml) (revision d364178ab42a711fa1e0a41f05c61aa4b4489de0) +++ sources/gui/qml/components/TimeText.qml (.../TimeText.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -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 (c) 2020-2024 Diality Inc. - All Rights Reserved. + * \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 TimeText.qml - * \date 2020/02/03 - * \author Behrouz NematiPour + * \author (last) Behrouz NematiPour + * \date (last) 30-Aug-2022 + * \author (original) Behrouz NematiPour + * \date (original) 04-Feb-2020 * */ @@ -27,15 +28,20 @@ objectName: "_TimeText" //SquishQt testability property int seconds : 0 property bool secondsVisible : true - property color textColor : "white" + + property bool hourZero : true + property bool minuteZero : true + property bool secondZero : true + + property color textColor : Colors.textMain property int textPixelSize : 90 property int textWeight : Font.ExtraLight property int secsPixelSize : 16 readonly property string time : _private.time - color : "transparent" - width : _hourText.contentWidth + _timeSeparator.contentWidth + _minuteText.contentWidth + color : Colors.transparent + width : _hourText.contentWidth + _timeSeparator.contentWidth + _minuteText.contentWidth + _timeSeparator.contentWidth height: _timeSeparator.height QtObject { id: _private @@ -44,9 +50,9 @@ property int second : seconds % 60 property string separator : ":" - property string hourText : (hour < 10 ? "0" + hour : hour ) - property string minuteText : (minute < 10 ? "0" + minute : minute) - property string secondText : (second < 10 ? "0" + second : second) + property string hourText : (hour < 10 ? ( _root.hourZero ? "0" : "") + hour : hour ) + property string minuteText : (minute < 10 ? ( _root.minuteZero ? "0" : "") + minute : minute) + property string secondText : (second < 10 ? ( _root.secondZero ? "0" : "") + second : second) property string time : hourText + separator + minuteText + (_root.secondsVisible ? (separator + secondText) : "") } @@ -73,7 +79,6 @@ horizontalAlignment: Text.AlignRight anchors.right : _timeSeparator.left anchors.baseline: _timeSeparator.baseline - } Text { id: _minuteText objectName: "_TimeText_minute" //SquishQt testability