diff --git a/applets/systemtray/package/contents/ui/items/PlasmoidItem.qml b/applets/systemtray/package/contents/ui/items/PlasmoidItem.qml --- a/applets/systemtray/package/contents/ui/items/PlasmoidItem.qml +++ b/applets/systemtray/package/contents/ui/items/PlasmoidItem.qml @@ -54,7 +54,14 @@ onHeightChanged: { if (applet) { - applet.width = height + applet.width = Math.min(plasmoidContainer.width, plasmoidContainer.height) + applet.height = applet.width + } + } + onWidthChanged: { + if (applet) { + applet.width = Math.min(plasmoidContainer.width, plasmoidContainer.height) + applet.height = applet.width } } @@ -71,11 +78,10 @@ if (applet) { applet.parent = plasmoidContainer applet.anchors.left = plasmoidContainer.left - applet.anchors.top = plasmoidContainer.top - applet.anchors.bottom = plasmoidContainer.bottom - applet.width = plasmoidContainer.height + applet.anchors.verticalCenter = plasmoidContainer.verticalCenter + applet.width = Math.min(plasmoidContainer.width, plasmoidContainer.height) + applet.height = applet.width applet.visible = true - plasmoidContainer.visible = true preloadFullRepresentationItem(applet.fullRepresentationItem) } diff --git a/applets/systemtray/package/contents/ui/main.qml b/applets/systemtray/package/contents/ui/main.qml --- a/applets/systemtray/package/contents/ui/main.qml +++ b/applets/systemtray/package/contents/ui/main.qml @@ -154,8 +154,8 @@ interactive: false //disable features we don't need flow: vertical ? GridView.LeftToRight : GridView.TopToBottom - cellHeight: root.itemSize + units.smallSpacing - cellWidth: root.itemSize + units.smallSpacing + cellHeight: Math.min(root.itemSize + units.smallSpacing, root.height) + cellWidth: Math.min(root.itemSize + units.smallSpacing, root.width) readonly property int columns: !vertical ? Math.ceil(count / rows) : Math.max(1, Math.floor(root.width / cellWidth))