Commit 1f0f210a authored by Noah Davis's avatar Noah Davis 🌵

Don't use parent height/width for implicit ToolSeparator sizing

I realized this was pretty much all wrong, so I rewrote the whole thing with a structure inspired by the Default QQC2 theme.

Padding property was removed since it was originally added to give the
separator back the padding that it lost by having the same height as the
parent.

BUG: 425949
parent 66f318b6
......@@ -12,18 +12,14 @@ import org.kde.kirigami 2.4 as Kirigami
T.ToolSeparator {
id: controlRoot
topPadding: Kirigami.Units.smallSpacing
bottomPadding: Kirigami.Units.smallSpacing
leftPadding: Kirigami.Units.smallSpacing
rightPadding: Kirigami.Units.smallSpacing
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
implicitWidth: separator.width + controlRoot.leftPadding + controlRoot.rightPadding
implicitHeight: parent.height - topPadding - bottomPadding
background: Kirigami.Separator {
id: separator
anchors.centerIn: controlRoot
height: controlRoot.height
width: implicitWidth
contentItem: Kirigami.Separator {
// implicitHeight is the same as ToolBar implicitHeight minus ToolBar padding if not horizontal
implicitHeight: horizontal ? Math.floor(Kirigami.Units.devicePixelRatio) : 40 - (Kirigami.Units.smallSpacing * 2)
implicitWidth: horizontal ? 40 - (Kirigami.Units.smallSpacing * 2) : Math.floor(Kirigami.Units.devicePixelRatio)
}
}
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