Commit 82a86854 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇 Committed by Volker Krause
Browse files

[Delegates] Use preferredWidth instead of width

When an item is inside a Layout, its width (and height) gets managed by said
layout, taking into account minimum/maximum/preferredWidth and implicitWidth.

Assigning width manually, does not behave as one expect here, since
Kirigami.Icon has an implicit size (of 32) and so with the nature of a ListView
creating delegates as you scroll, it becomes somewhat random which size
wins in the end, and might even change as an item goes out of view and back in.

While at it, use `smallMedium`, which, from the actual looks of the outcome
of this bug, is what the delegate should have been using. (Imho small is too small)
parent 79efe85b
......@@ -33,8 +33,8 @@ Kirigami.AbstractCard {
Kirigami.Icon {
source: "documentinfo"
width: Kirigami.Units.iconSizes.small
height: width
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
Layout.preferredHeight: Layout.preferredWidth
color: Kirigami.Theme.neutralTextColor
isMask: true
}
......
......@@ -71,8 +71,8 @@ Kirigami.AbstractCard {
Kirigami.Icon {
source: headerIconSource
width: Kirigami.Units.iconSizes.small
height: width
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
Layout.preferredHeight: Layout.preferredWidth
color: Kirigami.Theme.textColor
isMask: true
}
......
......@@ -34,8 +34,8 @@ Kirigami.AbstractCard {
Kirigami.Icon {
source: "qrc:///images/transfer.svg"
width: Kirigami.Units.iconSizes.small
height: width
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
Layout.preferredHeight: Layout.preferredWidth
color: Kirigami.Theme.textColor
isMask: true
}
......
......@@ -44,8 +44,8 @@ Kirigami.AbstractCard {
case TimelineElement.RangeBegin: return "go-down-symbolic";
case TimelineElement.RangeEnd: return "go-up-symbolic";
}
width: Kirigami.Units.iconSizes.small
height: width
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
Layout.preferredHeight: Layout.preferredWidth
color: Kirigami.Theme.textColor
isMask: true
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment