1/* 2 SPDX-FileCopyrightText: 2021 Michail Vourlakos <mvourlakos@gmail.com> 3 SPDX-License-Identifier: GPL-2.0-or-later 4*/ 5 6import QtQuick 2.7 7 8import org.kde.plasma.plasmoid 2.0 9import org.kde.plasma.core 2.0 as PlasmaCore 10 11import org.kde.latte.core 0.2 as LatteCore 12 13Item { 14 //! ListView Layout States 15 states: [ 16 ///Bottom Edge 17 State { 18 name: "bottomCenter" 19 when: (_abilityContainer.location===PlasmaCore.Types.BottomEdge && _abilityContainer.alignment===LatteCore.Types.Center) 20 21 AnchorChanges { 22 target: anchorsLoader.anchoredItem 23 anchors{ top:undefined; bottom:parent.bottom; left:undefined; right:undefined; horizontalCenter:parent.horizontalCenter; verticalCenter:undefined} 24 } 25 }, 26 State { 27 name: "bottomLeft" 28 when: (_abilityContainer.location===PlasmaCore.Types.BottomEdge && _abilityContainer.alignment===LatteCore.Types.Left) 29 30 AnchorChanges { 31 target: anchorsLoader.anchoredItem 32 anchors{ top:undefined; bottom:parent.bottom; left:parent.left; right:undefined; horizontalCenter:undefined; verticalCenter:undefined} 33 } 34 }, 35 State { 36 name: "bottomRight" 37 when: (_abilityContainer.location===PlasmaCore.Types.BottomEdge && _abilityContainer.alignment===LatteCore.Types.Right) 38 39 AnchorChanges { 40 target: anchorsLoader.anchoredItem 41 anchors{ top:undefined; bottom:parent.bottom; left:undefined; right:parent.right; horizontalCenter:undefined; verticalCenter:undefined} 42 } 43 }, 44 ///Top Edge 45 State { 46 name: "topCenter" 47 when: (_abilityContainer.location===PlasmaCore.Types.TopEdge && _abilityContainer.alignment===LatteCore.Types.Center) 48 49 AnchorChanges { 50 target: anchorsLoader.anchoredItem 51 anchors{ top:parent.top; bottom:undefined; left:undefined; right:undefined; horizontalCenter:parent.horizontalCenter; verticalCenter:undefined} 52 } 53 }, 54 State { 55 name: "topLeft" 56 when: (_abilityContainer.location===PlasmaCore.Types.TopEdge && _abilityContainer.alignment===LatteCore.Types.Left) 57 58 AnchorChanges { 59 target: anchorsLoader.anchoredItem 60 anchors{ top:parent.top; bottom:undefined; left:parent.left; right:undefined; horizontalCenter:undefined; verticalCenter:undefined} 61 } 62 }, 63 State { 64 name: "topRight" 65 when: (_abilityContainer.location===PlasmaCore.Types.TopEdge && _abilityContainer.alignment===LatteCore.Types.Right) 66 67 AnchorChanges { 68 target: anchorsLoader.anchoredItem 69 anchors{ top:parent.top; bottom:undefined; left:undefined; right:parent.right; horizontalCenter:undefined; verticalCenter:undefined} 70 } 71 }, 72 ////Left Edge 73 State { 74 name: "leftCenter" 75 when: (_abilityContainer.location===PlasmaCore.Types.LeftEdge && _abilityContainer.alignment===LatteCore.Types.Center) 76 77 AnchorChanges { 78 target: anchorsLoader.anchoredItem 79 anchors{ top:undefined; bottom:undefined; left:parent.left; right:undefined; horizontalCenter:undefined; verticalCenter:parent.verticalCenter} 80 } 81 }, 82 State { 83 name: "leftTop" 84 when: (_abilityContainer.location===PlasmaCore.Types.LeftEdge && _abilityContainer.alignment===LatteCore.Types.Top) 85 86 AnchorChanges { 87 target: anchorsLoader.anchoredItem 88 anchors{ top:parent.top; bottom:undefined; left:parent.left; right:undefined; horizontalCenter:undefined; verticalCenter:undefined} 89 } 90 }, 91 State { 92 name: "leftBottom" 93 when: (_abilityContainer.location===PlasmaCore.Types.LeftEdge && _abilityContainer.alignment===LatteCore.Types.Bottom) 94 95 AnchorChanges { 96 target: anchorsLoader.anchoredItem 97 anchors{ top:undefined; bottom:parent.bottom; left:parent.left; right:undefined; horizontalCenter:undefined; verticalCenter:undefined} 98 } 99 }, 100 ///Right Edge 101 State { 102 name: "rightCenter" 103 when: (_abilityContainer.location===PlasmaCore.Types.RightEdge && _abilityContainer.alignment===LatteCore.Types.Center) 104 105 AnchorChanges { 106 target: anchorsLoader.anchoredItem 107 anchors{ top:undefined; bottom:undefined; left:undefined; right:parent.right; horizontalCenter:undefined; verticalCenter:parent.verticalCenter} 108 } 109 }, 110 State { 111 name: "rightTop" 112 when: (_abilityContainer.location===PlasmaCore.Types.RightEdge && _abilityContainer.alignment===LatteCore.Types.Top) 113 114 AnchorChanges { 115 target: anchorsLoader.anchoredItem 116 anchors{ top:parent.top; bottom:undefined; left:undefined; right:parent.right; horizontalCenter:undefined; verticalCenter:undefined} 117 } 118 }, 119 State { 120 name: "rightBottom" 121 when: (_abilityContainer.location===PlasmaCore.Types.RightEdge && _abilityContainer.alignment===LatteCore.Types.Bottom) 122 123 AnchorChanges { 124 target: anchorsLoader.anchoredItem 125 anchors{ top:undefined; bottom:parent.bottom; left:undefined; right:parent.right; horizontalCenter:undefined; verticalCenter:undefined} 126 } 127 } 128 ] 129} 130