[ui] Controls: add Group custom control

This commit is contained in:
Yann Lanthony 2018-12-07 14:53:45 +01:00
parent 2f307c16fb
commit 1c070c7fdb
2 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,47 @@
import QtQuick 2.7
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import MaterialIcons 2.2
/**
* A custom GroupBox with predefined header.
*/
GroupBox {
id: root
title: ""
property int sidePadding: 6
property alias labelBackground: labelBg
property alias toolBarContent: toolBar.data
padding: 2
leftPadding: sidePadding
rightPadding: sidePadding
topPadding: label.height + padding
background: Item {}
label: Pane {
background: Rectangle {
id: labelBg
color: palette.base
opacity: 0.8
}
padding: 2
width: root.width
RowLayout {
width: parent.width
Label {
text: root.title
Layout.fillWidth: true
elide: Text.ElideRight
padding: 3
font.bold: true
font.pointSize: 8
}
RowLayout {
id: toolBar
height: parent.height
}
}
}
}