[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.
wilder-5.25
ivan tkachenko 4 years ago
parent f5d9e5d5a2
commit d56d8ab2e0
  1. 10
      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

Loading…
Cancel
Save