From 90cafd4176f1259d80fbe090f25ec9301ab0877c Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 4 Feb 2021 19:17:57 +0200 Subject: [PATCH] use Ability BasicItem.location in its subparts --- .../abilities/items/BasicItem.qml | 24 +++++++++---------- .../items/basicitem/IndicatorLevel.qml | 8 +++---- .../items/basicitem/ParabolicItem.qml | 16 ++++++------- .../items/basicitem/TitleTooltipParent.qml | 8 +++---- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/declarativeimports/abilities/items/BasicItem.qml b/declarativeimports/abilities/items/BasicItem.qml index 0299aa9eb..f8797340c 100644 --- a/declarativeimports/abilities/items/BasicItem.qml +++ b/declarativeimports/abilities/items/BasicItem.qml @@ -37,10 +37,10 @@ Item{ signal shortcutRequestedActivate(); signal shortcutRequestedNewInstance(); - anchors.bottom: (parent && plasmoid.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined - anchors.top: (parent && plasmoid.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined - anchors.left: (parent && plasmoid.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined - anchors.right: (parent && plasmoid.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined + anchors.bottom: (parent && abilityItem.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined + anchors.top: (parent && abilityItem.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined + anchors.left: (parent && abilityItem.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined + anchors.right: (parent && abilityItem.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined width: { if (!visible) @@ -111,10 +111,10 @@ Item{ readonly property bool parabolicAreaContainsMouse: parabolicEventsAreaLoader.active && parabolicEventsAreaLoader.item.containsMouse readonly property int location: { - if (plasmoid.location === PlasmaCore.Types.LeftEdge - || plasmoid.location === PlasmaCore.Types.RightEdge - || plasmoid.location === PlasmaCore.Types.TopEdge) { - return plasmoid.location; + if (abilityItem.location === PlasmaCore.Types.LeftEdge + || abilityItem.location === PlasmaCore.Types.RightEdge + || abilityItem.location === PlasmaCore.Types.TopEdge) { + return abilityItem.location; } return PlasmaCore.Types.BottomEdge; @@ -290,7 +290,7 @@ Item{ states:[ State{ name: "top" - when: plasmoid.location === PlasmaCore.Types.TopEdge + when: abilityItem.location === PlasmaCore.Types.TopEdge AnchorChanges{ target: parabolicEventsAreaLoader @@ -300,7 +300,7 @@ Item{ }, State{ name: "left" - when: plasmoid.location === PlasmaCore.Types.LeftEdge + when: abilityItem.location === PlasmaCore.Types.LeftEdge AnchorChanges{ target: parabolicEventsAreaLoader @@ -310,7 +310,7 @@ Item{ }, State{ name: "right" - when: plasmoid.location === PlasmaCore.Types.RightEdge + when: abilityItem.location === PlasmaCore.Types.RightEdge AnchorChanges{ target: parabolicEventsAreaLoader @@ -320,7 +320,7 @@ Item{ }, State{ name: "bottom" - when: plasmoid.location === PlasmaCore.Types.BottomEdge + when: abilityItem.location === PlasmaCore.Types.BottomEdge AnchorChanges{ target: parabolicEventsAreaLoader diff --git a/declarativeimports/abilities/items/basicitem/IndicatorLevel.qml b/declarativeimports/abilities/items/basicitem/IndicatorLevel.qml index f5091fa8a..009995908 100644 --- a/declarativeimports/abilities/items/basicitem/IndicatorLevel.qml +++ b/declarativeimports/abilities/items/basicitem/IndicatorLevel.qml @@ -26,10 +26,10 @@ import org.kde.latte.abilities.items 0.1 as AbilityItem AbilityItem.IndicatorLevel { id: indicatorLevel - anchors.bottom: (plasmoid.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined - anchors.top: (plasmoid.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined - anchors.left: (plasmoid.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined - anchors.right: (plasmoid.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined + anchors.bottom: (abilityItem.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined + anchors.top: (abilityItem.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined + anchors.left: (abilityItem.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined + anchors.right: (abilityItem.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined anchors.horizontalCenter: abilityItem.isHorizontal ? parent.horizontalCenter : undefined anchors.verticalCenter: abilityItem.isHorizontal ? undefined : parent.verticalCenter diff --git a/declarativeimports/abilities/items/basicitem/ParabolicItem.qml b/declarativeimports/abilities/items/basicitem/ParabolicItem.qml index ef6a5ed82..b7ade3aae 100644 --- a/declarativeimports/abilities/items/basicitem/ParabolicItem.qml +++ b/declarativeimports/abilities/items/basicitem/ParabolicItem.qml @@ -93,18 +93,18 @@ Item{ } Item{ - anchors.bottom: (plasmoid.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined - anchors.top: (plasmoid.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined - anchors.left: (plasmoid.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined - anchors.right: (plasmoid.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined + anchors.bottom: (abilityItem.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined + anchors.top: (abilityItem.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined + anchors.left: (abilityItem.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined + anchors.right: (abilityItem.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined anchors.horizontalCenter: abilityItem.isHorizontal ? parent.horizontalCenter : undefined anchors.verticalCenter: abilityItem.isHorizontal ? undefined : parent.verticalCenter - anchors.bottomMargin: (plasmoid.location === PlasmaCore.Types.BottomEdge) ? abilityItem.abilities.metrics.margin.screenEdge : 0 - anchors.topMargin: (plasmoid.location === PlasmaCore.Types.TopEdge) ? abilityItem.abilities.metrics.margin.screenEdge : 0 - anchors.leftMargin: (plasmoid.location === PlasmaCore.Types.LeftEdge) ? abilityItem.abilities.metrics.margin.screenEdge : 0 - anchors.rightMargin: (plasmoid.location === PlasmaCore.Types.RightEdge) ? abilityItem.abilities.metrics.margin.screenEdge : 0 + anchors.bottomMargin: (abilityItem.location === PlasmaCore.Types.BottomEdge) ? abilityItem.abilities.metrics.margin.screenEdge : 0 + anchors.topMargin: (abilityItem.location === PlasmaCore.Types.TopEdge) ? abilityItem.abilities.metrics.margin.screenEdge : 0 + anchors.leftMargin: (abilityItem.location === PlasmaCore.Types.LeftEdge) ? abilityItem.abilities.metrics.margin.screenEdge : 0 + anchors.rightMargin: (abilityItem.location === PlasmaCore.Types.RightEdge) ? abilityItem.abilities.metrics.margin.screenEdge : 0 anchors.horizontalCenterOffset: abilityItem.iconOffsetX anchors.verticalCenterOffset: abilityItem.iconOffsetY diff --git a/declarativeimports/abilities/items/basicitem/TitleTooltipParent.qml b/declarativeimports/abilities/items/basicitem/TitleTooltipParent.qml index 3131494e0..08b08c037 100644 --- a/declarativeimports/abilities/items/basicitem/TitleTooltipParent.qml +++ b/declarativeimports/abilities/items/basicitem/TitleTooltipParent.qml @@ -34,7 +34,7 @@ Item{ states:[ State{ name: "bottom" - when: plasmoid.location === PlasmaCore.Types.BottomEdge + when: abilityItem.location === PlasmaCore.Types.BottomEdge AnchorChanges{ target: visual; @@ -45,7 +45,7 @@ Item{ }, State{ name: "top" - when: plasmoid.location === PlasmaCore.Types.TopEdge + when: abilityItem.location === PlasmaCore.Types.TopEdge AnchorChanges{ target:visual; @@ -56,7 +56,7 @@ Item{ }, State{ name: "left" - when: plasmoid.location === PlasmaCore.Types.LeftEdge + when: abilityItem.location === PlasmaCore.Types.LeftEdge AnchorChanges{ target: visual; @@ -67,7 +67,7 @@ Item{ }, State{ name: "right" - when: plasmoid.location === PlasmaCore.Types.RightEdge + when: abilityItem.location === PlasmaCore.Types.RightEdge AnchorChanges{ target: visual;