Skip to content

Commit 913dee2

Browse files
vsklencarwonder-sk
authored andcommitted
[QgsQuick] Feature form group styling
Added margin to group title box - size and color properties have been added to group styling.
1 parent 4a3bac8 commit 913dee2

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

src/quickgui/plugin/qgsquickfeatureform.qml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,18 +257,30 @@ Item {
257257
section.property: "Group"
258258
section.labelPositioning: ViewSection.CurrentLabelAtStart | ViewSection.InlineLabels
259259
section.delegate: Component {
260-
// section header: group box name
261-
Rectangle {
260+
261+
// section header: group box name
262+
Rectangle {
262263
width: parent.width
263264
height: section === "" ? 0 : form.style.group.height
264-
color: form.style.group.backgroundColor
265-
266-
Text {
267-
anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter }
268-
font.bold: true
269-
font.pixelSize: form.style.group.fontPixelSize
270-
text: section
271-
color: form.style.group.fontColor
265+
color: form.style.group.marginColor
266+
267+
Rectangle {
268+
anchors.fill: parent
269+
anchors {
270+
leftMargin: form.style.group.leftMargin
271+
rightMargin: form.style.group.rightMargin
272+
topMargin: form.style.group.topMargin
273+
bottomMargin: form.style.group.bottomMargin
274+
}
275+
color: form.style.group.backgroundColor
276+
277+
Text {
278+
anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter }
279+
font.bold: true
280+
font.pixelSize: form.style.group.fontPixelSize
281+
text: section
282+
color: form.style.group.fontColor
283+
}
272284
}
273285
}
274286
}

src/quickgui/plugin/qgsquickfeatureformstyling.qml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ QtObject {
2323

2424
property QtObject group: QtObject {
2525
property color backgroundColor: "lightGray"
26+
property color marginColor: "black"
27+
property real leftMargin: 1 * QgsQuick.Utils.dp
28+
property real rightMargin: 1 * QgsQuick.Utils.dp
29+
property real topMargin: 1 * QgsQuick.Utils.dp
30+
property real bottomMargin: 1 * QgsQuick.Utils.dp
2631
property real height: 64 * QgsQuick.Utils.dp
2732
property color fontColor: "black"
2833
property int spacing: 10 * QgsQuick.Utils.dp

0 commit comments

Comments
 (0)