/* * Copyright 2020 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ 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 //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: (root.dragOverlay && root.dragOverlay.pressed) || appletsInParentChange 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(); } } onFillAppletsChanged: layouter.updateSizeForAppletsInFill(); onShownAppletsChanged: layouter.updateSizeForAppletsInFill(); onSizeWithNoFillAppletsChanged: layouter.updateSizeForAppletsInFill(); }