feat(StatusModal): render header and footer border by default

This adds a `StatusModalDivider` to the header and footer so they don't
have to be put into `content` and therefore won't scroll out of the viewport
if the content exceeds the modal height.

The footer divider is only rendered when there's indeed action buttons
provided.

Closes #265
This commit is contained in:
Pascal Precht 2021-07-16 09:13:02 +02:00 committed by Michał Cieślak
parent 43623b3c7b
commit 8038a27ca4
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
Rectangle {
@ -65,5 +66,11 @@ Rectangle {
width: parent.width
height: parent.radius
color: parent.color
StatusModalDivider {
visible: (statusModalFooter.leftButtons.length || statusModalFooter.rightButtons.length) && rootLayout.height > 1
anchors.top: parent.top
width: parent.width
}
}
}

View File

@ -4,6 +4,7 @@ import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
Rectangle {
id: statusModalHeader
@ -66,5 +67,10 @@ Rectangle {
width: parent.width
height: parent.radius
color: parent.color
StatusModalDivider {
anchors.bottom: parent.bottom
width: parent.width
}
}
}