Warning, /plasma/latte-dock/containment/package/contents/ui/abilities/Layouter.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 import QtQuick 2.7 0007 import org.kde.plasma.plasmoid 2.0 0008 0009 import "./privates" as Ability 0010 0011 Ability.LayouterPrivate { 0012 id: _layouter 0013 0014 property bool appletsInParentChange: false 0015 0016 readonly property bool inNormalFillCalculationsState: animations.needBothAxis.count === 0 0017 && animations.needThickness.count === 0 0018 && (animations.needLength.count === 0 || root.dragInfo.entered) /*update when the user drags a plasmoid on the view*/ 0019 && !appletsInParentChange 0020 // && (!dragOverlay || (dragOverlay && !dragOverlay.pressed)) /*do not update during moving/dragging applets*/ 0021 0022 readonly property bool maxMetricsInHigherPriority: root.minLength === root.maxLength 0023 0024 function updateSizeForAppletsInFill() { 0025 if (!updateSizeForAppletsInFillTimer.running) { 0026 _layouter._updateSizeForAppletsInFill(); 0027 updateSizeForAppletsInFillTimer.start(); 0028 } 0029 } 0030 0031 onInNormalFillCalculationsStateChanged: { 0032 if (inNormalFillCalculationsState) { 0033 _layouter.updateSizeForAppletsInFill(); 0034 } 0035 } 0036 0037 onMaxLengthChanged: { 0038 _layouter.updateSizeForAppletsInFill(); 0039 } 0040 0041 Connections { 0042 target: layouts 0043 onContentsLengthChanged: _layouter.updateSizeForAppletsInFill(); 0044 } 0045 0046 Connections { 0047 target: metrics 0048 onIconSizeChanged: _layouter.updateSizeForAppletsInFill(); 0049 } 0050 0051 Connections { 0052 target: plasmoid 0053 onFormFactorChanged: _layouter.updateSizeForAppletsInFill(); 0054 } 0055 0056 Connections { 0057 target: visibilityManager 0058 onInNormalStateChanged: { 0059 if (visibilityManager.inNormalState) { 0060 _layouter.updateSizeForAppletsInFill(); 0061 } 0062 } 0063 } 0064 0065 //! This timer is needed in order to reduce the calls to heavy cpu function 0066 //! updateSizeForAppletsInFill() 0067 Timer{ 0068 id: updateSizeForAppletsInFillTimer 0069 interval: 75 0070 onTriggered: _layouter._updateSizeForAppletsInFill(); 0071 } 0072 }