diff --git a/applets/systemtray/package/contents/ui/items/AbstractItem.qml b/applets/systemtray/package/contents/ui/items/AbstractItem.qml index f8059fb9b..e882f8f30 100644 --- a/applets/systemtray/package/contents/ui/items/AbstractItem.qml +++ b/applets/systemtray/package/contents/ui/items/AbstractItem.qml @@ -136,8 +136,8 @@ PlasmaCore.ToolTipArea { readonly property int size: abstractItem.inVisibleLayout ? root.itemSize : units.iconSizes.medium Layout.alignment: Qt.AlignHCenter - implicitWidth: size - implicitHeight: size + implicitWidth: root.vertical && abstractItem.inVisibleLayout ? abstractItem.width : size + implicitHeight: !root.vertical && abstractItem.inVisibleLayout ? abstractItem.height : size Layout.topMargin: abstractItem.inHiddenLayout ? units.smallSpacing : 0 } PlasmaComponents.Label { diff --git a/applets/systemtray/package/contents/ui/main.qml b/applets/systemtray/package/contents/ui/main.qml index 6cd033a06..ba4f16964 100644 --- a/applets/systemtray/package/contents/ui/main.qml +++ b/applets/systemtray/package/contents/ui/main.qml @@ -156,13 +156,14 @@ MouseArea { interactive: false //disable features we don't need flow: vertical ? GridView.LeftToRight : GridView.TopToBottom - cellHeight: root.itemSize + units.smallSpacing - cellWidth: root.itemSize + units.smallSpacing - - readonly property int columns: !vertical ? Math.ceil(count / rows) - : Math.max(1, Math.floor(root.width / cellWidth)) - readonly property int rows: vertical ? Math.ceil(count / columns) - : Math.max(1, Math.floor(root.height / cellHeight)) + cellHeight: vertical ? cellLength : root.height / rows + cellWidth: vertical ? root.width / columns : cellLength + + readonly property int cellLength: root.itemSize + units.smallSpacing + readonly property int columns: !vertical ? Math.ceil(count / rows) : + Math.max(1, Math.floor(root.width / cellLength)) + readonly property int rows: vertical ? Math.ceil(count / columns) : + Math.max(1, Math.floor(root.height / cellLength)) implicitHeight: rows * cellHeight implicitWidth: columns * cellWidth