Summary: | First delegate of ListView within OverlaySheet it's initially drawn at wrong position | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kirigami | Reporter: | Ismael Asensio <isma.af> |
Component: | general | Assignee: | Marco Martin <notmart> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | 1i5t5.duncan, bart, bugseforuns, isma.af, kde, kwin-bugs-null, nate |
Priority: | NOR | ||
Version: | Master | ||
Target Milestone: | Not decided | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
QML test sample to reproduce the bug
affected GHNS window |
Description
Ismael Asensio
2020-05-31 10:20:09 UTC
I found where the bug is. This patch: Kirigami --- a/src/controls/templates/AbstractListItem.qml +++ b/src/controls/templates/AbstractListItem.qml @@ -143,7 +143,7 @@ T2.ItemDelegate { opacity: enabled ? 1 : 0.6 - height: visible ? implicitHeight : 0 + height: implicitHeight "fixes" it. visible is false when the view is initially created and updating it doesn't do the relayout I don't know if that last part is a sign of a QtQuick bug or one our side. meh, even a forceLayout() on the view after visible change doesn't help maybe should just forget about it tho i'm not sure how many apps this behavior change will break, so probably thins shouldn't be done I agree that this "fix" can break other existing apps that relay on non-visible delagates not taking any space (QQC2.ItemDelegate also behaves that way, but I think AbstractListItem does the right thing). But I think the problem is important enough as not to keep looking for the cause. When more and more apps are being migrated to kirigami, it's a matter of time that this will pop-up in more important places. I wonder why this affects only the first item y-position, and not the rest of them. Created attachment 133606 [details]
affected GHNS window
I'm attaching a screenshot showing an affected "get how new stuff" window.
Operating System: Arch Linux
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
*** Bug 435546 has been marked as a duplicate of this bug. *** As already hinted above, a workaround for this issue is to explicitly set the height on the ListSectionHeader, e.g.: height: implicitHeight |