Bug 462300

Summary: Excessive margins around Kirigami.Separator in FormLayout
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Kai Uwe Broulik <kde>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, notmart
Priority: NOR Keywords: regression
Version First Reported In: Master   
Target Milestone: Not decided   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.102
Sentry Crash Report:
Attachments: Screenshot of FormLayout

Description Kai Uwe Broulik 2022-11-27 09:06:40 UTC
Created attachment 154074 [details]
Screenshot of FormLayout

SUMMARY
When a Kirigami.Separator is used in a FormLayout as a section, there's excessive padding ontop of it. This wasn't there originally.

STEPS TO REPRODUCE

import QtQuick 2.15
import org.kde.kirigami 2.12 as Kirigami

Kirigami.FormLayout {
    width: 200
    
    Text {
        text: "item above separator"
    }
    
    Kirigami.Separator {
        Kirigami.FormData.isSection: true
    }
    
    Text {
        text: "item below separator"
    }
}

OBSERVED RESULT
Excessive padding above the separator

EXPECTED RESULT
Equal spacing above and below the separator

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: git master as of 2022-11-21

ADDITIONAL INFORMATION
Compare to original notification KCM which didn't have this: https://blog.broulik.de/wp-content/uploads/2019/05/Screenshot_20190508_094309.png
Comment 1 Nate Graham 2022-11-30 20:54:41 UTC
Yeah, confirmed.
Comment 2 Nate Graham 2022-12-02 00:27:44 UTC
Tried to GammaRay this to find out which item causes the unwanted extra spacing, and it reproducibly crashes the moment I navigate into the FormLayout. :/
Comment 3 Bug Janitor Service 2022-12-02 01:08:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/850
Comment 4 Nate Graham 2022-12-07 14:26:23 UTC
Git commit 6cfe4af123a98ecacec5580a5e228a847789d9ad by Nate Graham.
Committed on 07/12/2022 at 14:26.
Pushed by ngraham into branch 'master'.

FormLayout: remove excessive spacing above unlabeled separators

The clear intention of the code (as even evidenced by a code comment)
was to add more spacing above the label of a labeled separator item
being used as a section header. But the code was not checking for
whether the separator actually had a label, so the extra spacing log
was being inappropriately applied to all separator items.
FIXED-IN: 5.102

M  +2    -3    src/controls/FormLayout.qml

https://invent.kde.org/frameworks/kirigami/commit/6cfe4af123a98ecacec5580a5e228a847789d9ad