From 173a3cf16b0d2a4b5f734d3a8cac985a10181900 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 27 Jan 2021 19:36:57 +0200 Subject: [PATCH] plasmoid:access screenGeometry from MyView Ability --- containment/package/contents/ui/abilities/MyView.qml | 2 +- containment/package/contents/ui/main.qml | 2 -- plasmoid/package/contents/ui/main.qml | 5 +---- .../package/contents/ui/previews/ToolTipInstance.qml | 4 +++- plasmoid/package/contents/ui/task/TaskItem.qml | 10 +++++----- .../contents/ui/taskslayout/ScrollEdgeShadows.qml | 2 +- .../package/contents/ui/taskslayout/ScrollableList.qml | 2 +- 7 files changed, 12 insertions(+), 15 deletions(-) diff --git a/containment/package/contents/ui/abilities/MyView.qml b/containment/package/contents/ui/abilities/MyView.qml index d6a2ccbdd..5fb8299f0 100644 --- a/containment/package/contents/ui/abilities/MyView.qml +++ b/containment/package/contents/ui/abilities/MyView.qml @@ -51,7 +51,7 @@ Ability.MyViewPrivate { itemShadow.isEnabled: plasmoid.configuration.appletShadowsEnabled itemShadow.size: itemShadow.isEnabled ? (0.5*metrics.iconSize) * (plasmoid.configuration.shadowSize/100) : 0 - itemShadow.shadowColor: "#" + myView.decimalToHex(appShadowOpacity) + myView.itemShadowOpacity + itemShadow.shadowColor: "#" + myView.decimalToHex(itemShadowOpacity) + myView.itemShadowOpacity itemShadow.shadowSolidColor: "#" + myView.itemShadowCurrentColor } diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 75337b18b..84f861f8a 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -379,8 +379,6 @@ Item { } property int tasksCount: latteApplet ? latteApplet.tasksCount : 0 - - property rect screenGeometry: latteView ? latteView.screenGeometry : plasmoid.screenGeometry ///END properties from latteApplet diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 001093bc4..97f7ce725 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -193,9 +193,6 @@ Item { property alias tasksCount: tasksModel.count - readonly property real screenGeometryHeightRatio: screenGeometry.height / screenGeometry.width - readonly property rect screenGeometry: latteView ? latteView.screenGeometry : plasmoid.screenGeometry - property Item latteView: null //END Latte Dock Panel properties @@ -526,7 +523,7 @@ Item { id: tasksModel virtualDesktop: virtualDesktopInfo.currentDesktop - screenGeometry: root.screenGeometry + screenGeometry: appletAbilities.myView.screenGeometry // comment in order to support LTS Plasma 5.8 // screen: plasmoid.screen activity: appletAbilities.myView.isReady ? appletAbilities.myView.lastUsedActivity : activityInfo.currentActivity diff --git a/plasmoid/package/contents/ui/previews/ToolTipInstance.qml b/plasmoid/package/contents/ui/previews/ToolTipInstance.qml index 1faf64a97..7d531fefd 100644 --- a/plasmoid/package/contents/ui/previews/ToolTipInstance.qml +++ b/plasmoid/package/contents/ui/previews/ToolTipInstance.qml @@ -176,10 +176,12 @@ Column { width: header.width // similar to 0.5625 = 1 / (16:9) as most screens are // round necessary, otherwise shadow mask for players has gap! - height: Math.round(root.screenGeometryHeightRatio * width) + (!winTitle.visible? Math.round(winTitle.height) : 0) + activeTaskLine.height + height: Math.round(screenGeometryHeightRatio * width) + (!winTitle.visible? Math.round(winTitle.height) : 0) + activeTaskLine.height visible: isWin + readonly property real screenGeometryHeightRatio: appletAbilities.myView.screenGeometry.height / appletAbilities.myView.screenGeometry.width + Item { id: thumbnailSourceItem anchors.fill: parent diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index ed2ebaa9b..783467dca 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -538,7 +538,7 @@ Item { scaleFactor: taskItem.wrapper.mScale panelOpacity: root.currentPanelOpacity - shadowColor: taskItem.abilities.myView.itemShadow.shadowColorSolid + shadowColor: taskItem.abilities.myView.itemShadow.shadowSolidColor progressVisible: wrapper.progressVisible /*since 0.9.2*/ progress: wrapper.progress /*since 0.9.2*/ @@ -1040,16 +1040,16 @@ Item { if (taskItem.abilities.myView.isHidden) { if (root.location === PlasmaCore.Types.BottomEdge) { - globalChoords.y = root.screenGeometry.y+root.screenGeometry.height-1; + globalChoords.y = taskItem.abilities.myView.screenGeometry.y + taskItem.abilities.myView.screenGeometry.height-1; globalChoords.height = 1; } else if (root.location === PlasmaCore.Types.TopEdge) { - globalChoords.y = root.screenGeometry.y+1; + globalChoords.y = taskItem.abilities.myView.screenGeometry.y+1; globalChoords.height = 1; } else if (root.location === PlasmaCore.Types.LeftEdge) { - globalChoords.x = root.screenGeometry.x+1; + globalChoords.x = taskItem.abilities.myView.screenGeometry.x+1; globalChoords.width = 1; } else if (root.location === PlasmaCore.Types.RightEdge) { - globalChoords.x = root.screenGeometry.x+root.screenGeometry.width - 1; + globalChoords.x = taskItem.abilities.myView.screenGeometry.x + taskItem.abilities.myView.screenGeometry.width - 1; globalChoords.width = 1; } } diff --git a/plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml b/plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml index 957bb6a2a..76c2d3f07 100644 --- a/plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml +++ b/plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml @@ -28,7 +28,7 @@ Item { readonly property int gradientLength: appletAbilities.metrics.iconSize / 3 readonly property int thickness: appletAbilities.metrics.backgroundThickness - readonly property color appliedColor: root.abilities.myView.itemShadow.shadowSolidColor + readonly property color appliedColor: appletAbilities.myView.itemShadow.shadowSolidColor property Item flickable diff --git a/plasmoid/package/contents/ui/taskslayout/ScrollableList.qml b/plasmoid/package/contents/ui/taskslayout/ScrollableList.qml index b311cbb84..0df2c2224 100644 --- a/plasmoid/package/contents/ui/taskslayout/ScrollableList.qml +++ b/plasmoid/package/contents/ui/taskslayout/ScrollableList.qml @@ -169,7 +169,7 @@ Flickable{ var block = !root.autoScrollTasksEnabled && !duringDragging; if (block || !contentsExceed || root.tasksCount < 3 - || (task.itemIndex===task.abilities.indexer.lastVisibleItemIndex && appletAbilities.parabolic.factor.zoom>1)) { + || (task.itemIndex === appletAbilities.indexer.lastVisibleItemIndex && appletAbilities.parabolic.factor.zoom>1)) { //last task with parabolic effect breaks the autoscolling behavior return; }