From 0d023dff37380e5ff3a252e112ece289597e270b Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 10 May 2020 18:22:54 +0300 Subject: [PATCH] expose backgroundThickness through Metrics --this way Tasks scrolling shadows work ok again and also they are decoupled from containment --- containment/package/contents/ui/abilities/Metrics.qml | 1 + .../package/contents/ui/abilities/privates/MetricsPrivate.qml | 1 + containment/package/contents/ui/main.qml | 1 + declarativeimports/abilities/applets/Metrics.qml | 1 + declarativeimports/abilities/containers/Metrics.qml | 1 + declarativeimports/abilities/definitions/Metrics.qml | 1 + declarativeimports/abilities/definitions/metrics/Totals.qml | 2 +- plasmoid/package/contents/ui/abilities/Metrics.qml | 1 + plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml | 2 +- 9 files changed, 9 insertions(+), 2 deletions(-) diff --git a/containment/package/contents/ui/abilities/Metrics.qml b/containment/package/contents/ui/abilities/Metrics.qml index e87915b5a..337d82c22 100644 --- a/containment/package/contents/ui/abilities/Metrics.qml +++ b/containment/package/contents/ui/abilities/Metrics.qml @@ -29,6 +29,7 @@ Ability.MetricsPrivate { //! Public Properties iconSize: autosizeEnabled && autosize.iconSize > 0 ? Math.min(autosize.iconSize, maxIconSize) : maxIconSize maxIconSize: portionIconSize!==-1 ? portionIconSize : plasmoid.configuration.iconSize + backgroundThickness: background.thickness margin.length: fraction.lengthMargin * iconSize margin.thickness: fraction.thicknessMargin * iconSize diff --git a/containment/package/contents/ui/abilities/privates/MetricsPrivate.qml b/containment/package/contents/ui/abilities/privates/MetricsPrivate.qml index 28c6a0b42..7a72d2e96 100644 --- a/containment/package/contents/ui/abilities/privates/MetricsPrivate.qml +++ b/containment/package/contents/ui/abilities/privates/MetricsPrivate.qml @@ -28,6 +28,7 @@ ContainerAbility.Metrics { id: mets property Item animations: null property Item autosize: null + property Item background: null property Item indicators: null //! Private Properties diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index b238b82a6..9fe2c93ce 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -1593,6 +1593,7 @@ Item { id: _metrics animations: _animations autosize: _autosize + background: _background indicators: indicatorsManager } diff --git a/declarativeimports/abilities/applets/Metrics.qml b/declarativeimports/abilities/applets/Metrics.qml index 26c6e5dfd..58125bfb4 100644 --- a/declarativeimports/abilities/applets/Metrics.qml +++ b/declarativeimports/abilities/applets/Metrics.qml @@ -26,6 +26,7 @@ AbilityDefinition.Metrics { iconSize: ref.metrics.iconSize maxIconSize: ref.metrics.maxIconSize + backgroundThickness: ref.metrics.backgroundThickness margin: ref.metrics.margin padding: ref.metrics.padding diff --git a/declarativeimports/abilities/containers/Metrics.qml b/declarativeimports/abilities/containers/Metrics.qml index 2f414f190..359b1abbd 100644 --- a/declarativeimports/abilities/containers/Metrics.qml +++ b/declarativeimports/abilities/containers/Metrics.qml @@ -27,6 +27,7 @@ AbilityDefinition.Metrics { readonly property Item publicApi: Item { readonly property alias iconSize: apis.iconSize readonly property alias maxIconSize: apis.maxIconSize + readonly property alias backgroundThickness: apis.backgroundThickness readonly property alias margin: apis.margin readonly property alias padding: apis.padding diff --git a/declarativeimports/abilities/definitions/Metrics.qml b/declarativeimports/abilities/definitions/Metrics.qml index 18eceee22..9ba452223 100644 --- a/declarativeimports/abilities/definitions/Metrics.qml +++ b/declarativeimports/abilities/definitions/Metrics.qml @@ -24,6 +24,7 @@ import "./metrics" as MetricsTypes Item { property int iconSize: 48 property int maxIconSize: 48 + property int backgroundThickness: 16 property MetricsTypes.Margin margin: MetricsTypes.Margin{} property MetricsTypes.Padding padding: MetricsTypes.Padding{} diff --git a/declarativeimports/abilities/definitions/metrics/Totals.qml b/declarativeimports/abilities/definitions/metrics/Totals.qml index 50372e16f..9f19934bf 100644 --- a/declarativeimports/abilities/definitions/metrics/Totals.qml +++ b/declarativeimports/abilities/definitions/metrics/Totals.qml @@ -19,7 +19,7 @@ import QtQuick 2.0 -Item { +Item { readonly property int length: iconSize + lengthEdges readonly property int lengthEdge: margin.length + padding.length readonly property int lengthEdges: 2 * lengthEdge diff --git a/plasmoid/package/contents/ui/abilities/Metrics.qml b/plasmoid/package/contents/ui/abilities/Metrics.qml index a0974f370..c6ebdb8f8 100644 --- a/plasmoid/package/contents/ui/abilities/Metrics.qml +++ b/plasmoid/package/contents/ui/abilities/Metrics.qml @@ -26,6 +26,7 @@ import org.kde.latte.abilities.applets 0.1 as AppletAbility AppletAbility.Metrics { //! Public Local Properties local.iconSize: Math.max(plasmoid.configuration.iconSize, 16) + local.backgroundThickness: totals.thickness local.margin.length: 0.1 * iconSize local.margin.thickness: 0.16 * iconSize diff --git a/plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml b/plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml index 11d989f9c..c034b70e6 100644 --- a/plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml +++ b/plasmoid/package/contents/ui/taskslayout/ScrollEdgeShadows.qml @@ -27,7 +27,7 @@ Item { opacity: 0.4 readonly property int gradientLength: metrics.iconSize / 3 - readonly property int thickness: latteView ? latteView.realPanelSize : metrics.totals.thickness + readonly property int thickness: metrics.backgroundThickness readonly property color appliedColor: root.appShadowColorSolid property Item flickable