From 976e7a5ad99448594e49f1873c73f24462d47e15 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 14 Nov 2019 21:17:16 +0200 Subject: [PATCH] remove exceptions for systray and indicators --remove the layout exception for the plasma systray and behave for this just all the rest applets --fix indicators for applets in order to consider properly the indicators padding and applets margins. In other words the Latte indicators for applets should not take up all the length provided but ONLY the applet length + indicators padding (without at any case the applet length margins) BUG:414104 FIXED-IN:0.9.5 --- .../package/contents/ui/applet/AppletItem.qml | 4 +-- .../contents/ui/applet/indicator/Loader.qml | 25 +++++++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index f5e7b1a69..08e3bc2d1 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -164,9 +164,7 @@ Item { property Item latteStyleApplet: applet && ((applet.pluginName === "org.kde.latte.spacer") || (applet.pluginName === "org.kde.latte.separator")) ? (applet.children[0] ? applet.children[0] : null) : null - property Item appletWrapper: applet && - ((applet.pluginName === root.plasmoidName) || - isSystray) ? wrapper : wrapper.wrapperContainer + property Item appletWrapper: applet && (applet.pluginName === root.plasmoidName )? wrapper : wrapper.wrapperContainer property Item tooltipVisualParent: titleTooltipParent diff --git a/containment/package/contents/ui/applet/indicator/Loader.qml b/containment/package/contents/ui/applet/indicator/Loader.qml index c043625f0..cb745c0d9 100644 --- a/containment/package/contents/ui/applet/indicator/Loader.qml +++ b/containment/package/contents/ui/applet/indicator/Loader.qml @@ -42,8 +42,29 @@ Loader { return indicators.indicatorComponent; } - width: root.isHorizontal && canBeHovered ? appletItem.wrapperAlias.zoomScale * visualLockedWidth : appletItem.wrapperAlias.width - height: root.isVertical && canBeHovered ? appletItem.wrapperAlias.zoomScale * visualLockedHeight : appletItem.wrapperAlias.height + width: { + if (root.isHorizontal) { + if (canBeHovered) { + return appletItem.wrapperAlias.zoomScale * visualLockedWidth; + } + + return appletWrapper.width + appletItem.internalWidthMargins; + } else { + return appletItem.wrapperAlias.width; + } + } + + height: { + if (root.isVertical) { + if (canBeHovered) { + return appletItem.wrapperAlias.zoomScale * visualLockedHeight; + } + + return appletWrapper.height + appletItem.internalHeightMargins; + } else { + return appletItem.wrapperAlias.height; + } + } readonly property bool locked: appletItem.lockZoom || root.zoomFactor === 1