1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-27 06:03:51 +03:00

use Ability BasicItem.location in its subparts

This commit is contained in:
Michail Vourlakos 2021-02-04 19:17:57 +02:00
parent 0c273fcaf2
commit 90cafd4176
4 changed files with 28 additions and 28 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;