From f50dce3b13fc7b2eb40a13ad4675f1114ebd5ba4 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 24 Oct 2020 18:02:06 +0300 Subject: [PATCH] fix spacing and applets coloring --- .../contents/ui/items/AbstractItem.qml | 16 +++++++++++----- .../contents/ui/main.qml | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/org.kde.plasma.private.systemtray/contents/ui/items/AbstractItem.qml b/org.kde.plasma.private.systemtray/contents/ui/items/AbstractItem.qml index bc1bfac..64e03b5 100644 --- a/org.kde.plasma.private.systemtray/contents/ui/items/AbstractItem.qml +++ b/org.kde.plasma.private.systemtray/contents/ui/items/AbstractItem.qml @@ -129,14 +129,13 @@ PlasmaCore.ToolTipArea { } } - ColumnLayout { + id: itemColumn anchors.fill: abstractItem spacing: 0 Item { id: iconContainer - property alias inVisibleLayout: abstractItem.inVisibleLayout readonly property int size: abstractItem.inVisibleLayout ? root.itemSize : units.iconSizes.medium @@ -144,6 +143,8 @@ PlasmaCore.ToolTipArea { implicitWidth: root.vertical && abstractItem.inVisibleLayout ? abstractItem.width : size implicitHeight: !root.vertical && abstractItem.inVisibleLayout ? abstractItem.height : size Layout.topMargin: abstractItem.inHiddenLayout ? units.smallSpacing : 0 + + visible: !colorizerLoader.active } PlasmaComponents3.Label { id: label @@ -175,7 +176,10 @@ PlasmaCore.ToolTipArea { //!Latte Coloring Approach with Colorizer and BrightnessContrast for hovering effect Loader { id: colorizerLoader - anchors.fill: itemRow + anchors.centerIn: itemColumn + width: iconContainer.width + height: iconContainer.height + active: root.inLatte && !abstractItem.inHiddenLayout && !labelVisible @@ -193,7 +197,10 @@ PlasmaCore.ToolTipArea { Loader { id: hoveredColorizerLoader - anchors.fill: itemRow + anchors.centerIn: itemColumn + width: iconContainer.width + height: iconContainer.height + active: colorizerLoader.active z:1001 @@ -210,6 +217,5 @@ PlasmaCore.ToolTipArea { } } } - } diff --git a/org.kde.plasma.private.systemtray/contents/ui/main.qml b/org.kde.plasma.private.systemtray/contents/ui/main.qml index 7f6f0e8..b1b69e4 100644 --- a/org.kde.plasma.private.systemtray/contents/ui/main.qml +++ b/org.kde.plasma.private.systemtray/contents/ui/main.qml @@ -49,7 +49,7 @@ MouseArea { readonly property bool vertical: plasmoid.formFactor === PlasmaCore.Types.Vertical readonly property bool autoSize: plasmoid.configuration.scaleIconsToFit readonly property int cellThickness: root.vertical ? root.width : root.height - readonly property int rowsOrColumns: autoSize ? 1 : Math.max(1, Math.floor(cellThickness / (smallIconSize + PlasmaCore.Units.smallSpacing))) + readonly property int rowsOrColumns: autoSize ? 1 : Math.max(1, Math.floor(cellThickness / (smallIconSize + plasmoid.configuration.iconsSpacing))) property alias expanded: dialog.visible property Item activeApplet @@ -181,7 +181,7 @@ MouseArea { GridView { id: tasksGrid - readonly property int smallSizeCellLength: root.cellThickness >= root.smallIconSize ? root.smallIconSize + units.smallSpacing * 2 + readonly property int smallSizeCellLength: root.cellThickness >= root.smallIconSize ? root.smallIconSize + plasmoid.configuration.iconsSpacing : root.smallIconSize readonly property int autoSizeCellLength: root.cellThickness / root.rowsOrColumns readonly property int totalLength: root.vertical ? cellHeight * Math.round(count / root.rowsOrColumns)