From 8dd2ac8dd6d6dc8ba5e1db2ab2f6dd6dd3b48462 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Fri, 11 Nov 2022 22:10:17 -0500 Subject: [PATCH] homescreens/halcyon: Cap grid icon size relative to app name labels Prevents them from getting overly large in comparison to their labels --- .../package/contents/ui/GridAppDelegate.qml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml index 968b4ca6..c06e2ecb 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml @@ -127,15 +127,19 @@ MouseArea { } spacing: 0 - PlasmaCore.IconItem { + // Use Kirigami.Icon to have better icon dimension options + Kirigami.Icon { id: icon + Kirigami.Theme.inherit: false + Kirigami.Theme.colorSet: Kirigami.Theme.Complementary + Layout.alignment: Qt.AlignHCenter | Qt.AlignTop Layout.fillWidth: true - Layout.minimumHeight: Math.floor(parent.height - delegate.reservedSpaceForLabel) - Layout.preferredHeight: Layout.minimumHeight + Layout.preferredHeight: Math.floor(parent.height - delegate.reservedSpaceForLabel) + Layout.maximumHeight: labelFontMetrics.height * 7 + Layout.topMargin: Math.max(0, Layout.preferredHeight - height) - usesPlasmaTheme: false source: application.icon Rectangle { @@ -157,6 +161,11 @@ MouseArea { color: Qt.rgba(0, 0, 0, 0.3) } } + + FontMetrics { + id: labelFontMetrics + font: label.font + } } PlasmaComponents.Label {