Index: sources/gui/qml/compounds/TouchGrid.qml =================================================================== diff -u -r86e9dfbff50cb7e16fd94c16c1c818cef3b47eac -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/gui/qml/compounds/TouchGrid.qml (.../TouchGrid.qml) (revision 86e9dfbff50cb7e16fd94c16c1c818cef3b47eac) +++ sources/gui/qml/compounds/TouchGrid.qml (.../TouchGrid.qml) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2021-2022 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2023 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 TouchGrid.qml * \author (last) Behrouz NematiPour - * \date (last) 13-Jun-2021 + * \date (last) 27-Jun-2022 * \author (original) Behrouz NematiPour * \date (original) 14-Apr-2021 * @@ -53,10 +53,27 @@ property int colCount : itemsText.length > rowCount ? Math.ceil(itemsText.length / rowCount) : 1 readonly property int titleTopMargin: 110 + readonly property alias itemsVisibleCount : _private.itemsVisibleCount + signal itemClicked(int vIndex) + QtObject { id: _private + property int itemsVisibleCount : 0 + } + + height: parent.height + onItemsVisibleChanged: { + let count = 0 + for ( let itemVisible of itemsVisible ) { + if ( itemVisible ) { + count++ + } + } + _private.itemsVisibleCount = count + } + function undef(vValue, vOtherwise) { if ( vValue === undefined ) { return vOtherwise @@ -72,7 +89,7 @@ columns : _root.colCount rows : _root.rowCount rowSpacing : 25 - columnSpacing : 100 + columnSpacing : itemsVisibleCount > rowCount ? 100 : 0 Repeater { model : _root.itemsText TouchRect { id: _touchItem