/* SPDX-FileCopyrightText: 2020 Michail Vourlakos SPDX-License-Identifier: GPL-2.0-or-later */ import QtQuick 2.7 Item { id: appletsContainer property Item grid: null // items in grid readonly property int count: grid.children.length property bool onlyInternalSplitters: false //it is used in calculations for fillWidth,fillHeight applets property int shownApplets: 0 property int fillApplets: 0 property int fillRealApplets: 0 //with no internal separators counted property int lengthWithoutSplitters: 0 //with no internal separators length //it is used in calculations for fillWidth,fillHeight applets property int sizeWithNoFillApplets: 0 readonly property int maxIndex: 99999 property int firstVisibleIndex: -1 property int lastVisibleIndex: -1 //! do not update during dragging/moving applets inConfigureAppletsMode readonly property bool updateIsBlocked: appletsInParentChange //|| (root.dragOverlay && root.dragOverlay.pressed) Binding{ target: appletsContainer property:"sizeWithNoFillApplets" when: appletsContainer && grid && !updateIsBlocked && inNormalFillCalculationsState value: { var space = 0; for (var i=0; i=0 && indexer.hidden.indexOf(appletItem.index)<0 && indexer.separators.indexOf(appletItem.index)<0 && appletItem.index < ind) { ind = appletItem.index; } } return ind === maxIndex ? -1 : ind; } } Binding{ target: appletsContainer property:"lastVisibleIndex" when: appletsContainer && grid && !updateIsBlocked value: { var ind = -1; for(var i=0; i=0 && indexer.hidden.indexOf(appletItem.index)<0 && indexer.separators.indexOf(appletItem.index)<0 && appletItem.index > ind) { ind = appletItem.index; } } return ind; } } Binding{ target: appletsContainer property:"onlyInternalSplitters" when: appletsContainer && grid && !updateIsBlocked && inNormalFillCalculationsState value: { var intsSplits = 0; for (var i=0; i 0) && (intsSplits === grid.children.length)); } } onCountChanged: { if (root.editMode) { //! this is mainly used when removing/adding internal view splitters //! in order to not break the parabolic effect from wrong indexes root.updateIndexes(); } } }