From d56d8ab2e03648cd04aca3e96b8ec8b3bccf6ffb Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Mon, 2 May 2022 01:36:49 +0300 Subject: [PATCH] [lookandfeel] Refactor OsdItem's sizing to use preferred size first Using "preferred" layout size as a source of truth is more correct than choosing between minimum and maximum sizes for that same purpose. This does not technically fix or impact anything per se; just makes the code slightly better. --- lookandfeel/contents/osd/OsdItem.qml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lookandfeel/contents/osd/OsdItem.qml b/lookandfeel/contents/osd/OsdItem.qml index 33fbb9df8..76eda19eb 100644 --- a/lookandfeel/contents/osd/OsdItem.qml +++ b/lookandfeel/contents/osd/OsdItem.qml @@ -28,10 +28,12 @@ RowLayout { spacing: PlasmaCore.Units.smallSpacing - Layout.minimumWidth: Math.max(Math.min(Screen.desktopAvailableWidth / 2, implicitWidth), PlasmaCore.Units.gridUnit * 15) - Layout.minimumHeight: PlasmaCore.Units.iconSizes.medium - Layout.maximumWidth: Layout.minimumWidth - Layout.maximumHeight: Layout.minimumHeight + Layout.preferredWidth: Math.max(Math.min(Screen.desktopAvailableWidth / 2, implicitWidth), PlasmaCore.Units.gridUnit * 15) + Layout.preferredHeight: PlasmaCore.Units.iconSizes.medium + Layout.minimumWidth: Layout.preferredWidth + Layout.minimumHeight: Layout.preferredHeight + Layout.maximumWidth: Layout.preferredWidth + Layout.maximumHeight: Layout.preferredHeight PlasmaCore.IconItem { Layout.leftMargin: PlasmaCore.Units.smallSpacing