Index: sources/gui/qml/components/Footer.qml =================================================================== diff -u -r903697f659a275a5be31d05c460dae628f532aab -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/components/Footer.qml (.../Footer.qml) (revision 903697f659a275a5be31d05c460dae628f532aab) +++ sources/gui/qml/components/Footer.qml (.../Footer.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-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 BackButton.qml + * \file Footer.qml * \author (last) Behrouz NematiPour - * \date (last) 17-Mar-2021 + * \date (last) 06-Oct-2022 * \author (original) Behrouz NematiPour - * \date (original) 17-Mar-2021 + * \date (original) 18-Mar-2021 * */ @@ -35,26 +35,38 @@ property int spacing : 0 } - // this code will run once and will not run for each child, - // that's becuase the available property to add children is the children property - // and that property can only change by assigning a list to it. - // so it happens once with no performance issue of multiple redundant call. - onVisibleChanged: { + function update() { // check there is a child let count = childrenCount if ( ! count ) return let width = childrenWidth - let spacing = (_root.width - (width * count)) / (count + 1) + let visibleCount = 0 for (let i = 0; i < count; i++) { - if (children[i].width !== width) { - children[i].width = width + //DEBUG: console.debug(children[i].text.text) + if ( children[i].visible ) { + + visibleCount += 1 + if (children[i].width !== width) { + children[i].width = width + } } + else { + children[i].width = 0 + } } + let spacing = (_root.width - (width * visibleCount)) / (visibleCount + 1) + //DEBUG: console.debug( " ~~~~~~~~~~ ", count, visibleCount, spacing) _private.spacing = spacing } + // this code will run once and will not run for each child, + // that's becuase the available property to add children is the children property + // and that property can only change by assigning a list to it. + // so it happens once with no performance issue of multiple redundant call. + onVisibleChanged : update() + spacing : _private.spacing rightPadding : _private.spacing leftPadding : _private.spacing