The Kirigami separator has spacing below it, but not above it when in a Form Layout. This patch adds a check if there is a separator present and if it is, it adds spacing above it.
BUG: 405614
mart | |
ngraham |
Kirigami |
The Kirigami separator has spacing below it, but not above it when in a Form Layout. This patch adds a check if there is a separator present and if it is, it adds spacing above it.
BUG: 405614
Before:
After:
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
@mart are you sure this is the right solution? From my tests the patch also adds extra spacing whenever there is an instance of isSection, but we'd only want it to do so when there is a separator present.
Before:
After:
We can see in this example when there is no separator that extra (unwanted) spacing has been added.
I don't like adding a new property to separator for doing duck typing...
even is really ugly and errorprone as well, but i would prefer
Layout.topMargin: item.toString().indexOf("Separator")===0 ? Kirigami.Units.smallSpacing : 0
with a comment:
// FIXME: use item instanceof Kirigami.Separator when we can depend from Qt 5.11