From f6c1d727d716157a7b9c04efc9a3f4794e4081fb Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 13 Sep 2021 18:26:05 +0200 Subject: [PATCH] Revert "phonepanel: Keep the Quick Settings buttons the same size" This reverts commit c4903c25b9e81d94ed7d68f29db6cf9422cd3e5d. (cherry picked from commit 43f2f293cf243c129d386e1ef617c26615f84db0) --- .../contents/ui/quicksettings/QuickSettingsPanel.qml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/containments/panel/package/contents/ui/quicksettings/QuickSettingsPanel.qml b/containments/panel/package/contents/ui/quicksettings/QuickSettingsPanel.qml index a3fba5f9..c1835654 100644 --- a/containments/panel/package/contents/ui/quicksettings/QuickSettingsPanel.qml +++ b/containments/panel/package/contents/ui/quicksettings/QuickSettingsPanel.qml @@ -94,6 +94,9 @@ Item { spacing: 0 height: Layout.minimumHeight * (1 - root.expandedRatio) + (Layout.maximumHeight * root.expandedRatio) + readonly property real cellSizeHint: PlasmaCore.Units.iconSizes.large + PlasmaCore.Units.smallSpacing * 6 + readonly property real columnWidth: Math.floor(width / Math.floor(width / cellSizeHint)) + // top indicators (clock, widgets, etc.) IndicatorsRow { id: indicatorsRow @@ -124,7 +127,7 @@ Item { readonly property real cellSizeHint: PlasmaCore.Units.iconSizes.large + PlasmaCore.Units.smallSpacing * 6 readonly property real columns: Math.floor(width / cellSizeHint) - readonly property real columnWidth: (flow.width / (flow.columns + 1)) * (root.expandedRatio > 0.4 ? 1 : (1 - root.expandedRatio) + (flow.width / flow.columns) * root.expandedRatio) + readonly property real columnWidth: Math.floor(width / columns) spacing: 0 @@ -133,8 +136,10 @@ Item { delegate: Delegate { id: delegateItem required property var modelData - width: flow.columnWidth - + width: root.expandedRatio < 0.4 + ? Math.max(implicitWidth + PlasmaCore.Units.smallSpacing * 2, flow.width / (flow.columns + 1)) + : Math.max(implicitWidth + PlasmaCore.Units.smallSpacing * 2, + (flow.width / (flow.columns + 1)) * (1 - root.expandedRatio) + (flow.width / flow.columns) * root.expandedRatio) labelOpacity: y > 0 ? 1 : root.expandedRatio opacity: y <= 0 ? 1 : root.expandedRatio