Skip to content

Commit

Permalink
[QgsQuick] Feature form group styling
Browse files Browse the repository at this point in the history
Added margin to group title box - size and color properties have been added to group styling.
  • Loading branch information
vsklencar authored and wonder-sk committed Apr 10, 2019
1 parent 4a3bac8 commit 913dee2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
32 changes: 22 additions & 10 deletions src/quickgui/plugin/qgsquickfeatureform.qml
Expand Up @@ -257,18 +257,30 @@ Item {
section.property: "Group"
section.labelPositioning: ViewSection.CurrentLabelAtStart | ViewSection.InlineLabels
section.delegate: Component {
// section header: group box name
Rectangle {

// section header: group box name
Rectangle {
width: parent.width
height: section === "" ? 0 : form.style.group.height
color: form.style.group.backgroundColor

Text {
anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter }
font.bold: true
font.pixelSize: form.style.group.fontPixelSize
text: section
color: form.style.group.fontColor
color: form.style.group.marginColor

Rectangle {
anchors.fill: parent
anchors {
leftMargin: form.style.group.leftMargin
rightMargin: form.style.group.rightMargin
topMargin: form.style.group.topMargin
bottomMargin: form.style.group.bottomMargin
}
color: form.style.group.backgroundColor

Text {
anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter }
font.bold: true
font.pixelSize: form.style.group.fontPixelSize
text: section
color: form.style.group.fontColor
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/quickgui/plugin/qgsquickfeatureformstyling.qml
Expand Up @@ -23,6 +23,11 @@ QtObject {

property QtObject group: QtObject {
property color backgroundColor: "lightGray"
property color marginColor: "black"
property real leftMargin: 1 * QgsQuick.Utils.dp
property real rightMargin: 1 * QgsQuick.Utils.dp
property real topMargin: 1 * QgsQuick.Utils.dp
property real bottomMargin: 1 * QgsQuick.Utils.dp
property real height: 64 * QgsQuick.Utils.dp
property color fontColor: "black"
property int spacing: 10 * QgsQuick.Utils.dp
Expand Down

0 comments on commit 913dee2

Please sign in to comment.