From ac8a88d70003e679a86ad8e1ee4a0b1dcab979d1 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 1 Mar 2021 01:17:12 +0200 Subject: [PATCH] improve AddItem visual --make it Square with small roundness in order to fit better at all cases --- containment/package/contents/ui/main.qml | 12 +++++++----- declarativeimports/components/AddItem.qml | 2 +- declarativeimports/components/AddingArea.qml | 5 ++++- plasmoid/package/contents/ui/main.qml | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 334f3d94f..e048414b8 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -1033,8 +1033,10 @@ Item { LatteComponents.AddItem{ id: dndSpacerAddItem - width: root.isHorizontal ? parent.width : parent.width - metrics.margin.screenEdge - height: root.isHorizontal ? parent.height - metrics.margin.screenEdge: parent.height + width: metrics.iconSize + height: metrics.iconSize + + property int thickMargin: metrics.margin.screenEdge + metrics.margin.thickness states:[ State{ @@ -1048,7 +1050,7 @@ Item { } PropertyChanges{ target: dndSpacerAddItem; - anchors.leftMargin: 0; anchors.rightMargin: 0; anchors.topMargin:0; anchors.bottomMargin: metrics.margin.screenEdge; + anchors.leftMargin: 0; anchors.rightMargin: 0; anchors.topMargin:0; anchors.bottomMargin: thickMargin; anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0; } }, @@ -1063,7 +1065,7 @@ Item { } PropertyChanges{ target: dndSpacerAddItem; - anchors.leftMargin: 0; anchors.rightMargin: 0; anchors.topMargin: metrics.margin.screenEdge; anchors.bottomMargin: 0; + anchors.leftMargin: 0; anchors.rightMargin: 0; anchors.topMargin: thickMargin; anchors.bottomMargin: 0; anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0; } }, @@ -1078,7 +1080,7 @@ Item { } PropertyChanges{ target: dndSpacerAddItem; - anchors.leftMargin: metrics.margin.screenEdge; anchors.rightMargin: 0; anchors.topMargin:0; anchors.bottomMargin: 0; + anchors.leftMargin: thickMargin; anchors.rightMargin: 0; anchors.topMargin:0; anchors.bottomMargin: 0; anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0; } }, diff --git a/declarativeimports/components/AddItem.qml b/declarativeimports/components/AddItem.qml index 28e0524e9..a7a3c0ba0 100644 --- a/declarativeimports/components/AddItem.qml +++ b/declarativeimports/components/AddItem.qml @@ -33,7 +33,7 @@ Item{ height: width anchors.centerIn: parent - radius: Math.max(width,height)/2 + radius: 0.05 * Math.max(width,height) color: Qt.rgba(theme.backgroundColor.r, theme.backgroundColor.g, theme.backgroundColor.b, backgroundOpacity) border.width: 1 diff --git a/declarativeimports/components/AddingArea.qml b/declarativeimports/components/AddingArea.qml index 65e83bedb..493d5709e 100644 --- a/declarativeimports/components/AddingArea.qml +++ b/declarativeimports/components/AddingArea.qml @@ -33,6 +33,8 @@ Rectangle{ property bool drawAddCross: true + property int iconSize: 64 + readonly property color outlineColorBase: theme.backgroundColor readonly property real outlineColorBaseBrightness: ColorizerTools.colorBrightness(outlineColorBase) readonly property color outlineColor: { @@ -157,7 +159,8 @@ Rectangle{ width: thickness height: thickness - readonly property int thickness: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? (parent.height - freeSpace):(parent.width - freeSpace) + readonly property int thickness: Math.min(addingArea.iconSize, + plasmoid.formFactor === PlasmaCore.Types.Horizontal ? (parent.height - freeSpace):(parent.width - freeSpace)) readonly property int freeSpace: Math.max(16, (heading.implicitHeight + units.smallSpacing*2)) } diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 6dc2eac8f..fd380539e 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -1050,6 +1050,7 @@ Item { radius: appletAbilities.metrics.iconSize/10 backgroundOpacity: mouseHandler.isDroppingOnlyLaunchers || appletAbilities.launchers.isShowingAddLaunchersMessage ? 0.75 : 0 duration: appletAbilities.animations.speedFactor.current + iconSize: appletAbilities.metrics.iconSize z: 99 title: i18n("Tasks Area")