2020-05-26 22:11:43 +00:00
|
|
|
import QtGraphicalEffects 1.0
|
|
|
|
import QtQuick 2.7
|
|
|
|
import QtQuick.Controls 2.4
|
|
|
|
import QtQuick.Controls.Material 2.0
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQuick.Window 2.11
|
|
|
|
import QtQuick.Controls 1.4
|
|
|
|
import QtQuick.Controls.Styles 1.4
|
|
|
|
|
|
|
|
import "." as Opaque
|
|
|
|
import "../opaque/styles"
|
|
|
|
import "../opaque/theme"
|
|
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: tehcol
|
|
|
|
|
2020-12-15 01:16:49 +00:00
|
|
|
width: parent.width - 2 * parent.padding
|
2020-05-26 22:11:43 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2020-12-15 01:16:49 +00:00
|
|
|
spacing: Theme.paddingSmall
|
2020-05-26 22:11:43 +00:00
|
|
|
property bool inline: true
|
|
|
|
property bool last: false
|
|
|
|
|
|
|
|
property alias label: settingLabel.text
|
2020-07-08 22:30:15 +00:00
|
|
|
property alias description: settingDescriptionLabel.text
|
2020-05-26 22:11:43 +00:00
|
|
|
property alias field: fieldContainer.children
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Grid {
|
|
|
|
id: container
|
|
|
|
columns: inline ? 2 : 1
|
2020-12-15 01:16:49 +00:00
|
|
|
spacing: Theme.paddingStandard
|
|
|
|
padding: Theme.paddingStandard
|
2020-05-26 22:11:43 +00:00
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
2020-12-15 01:16:49 +00:00
|
|
|
property int gridWidth: (inline ? (width - spacing)/2 : width) - 2*padding
|
2020-05-26 22:11:43 +00:00
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
2020-07-08 22:30:15 +00:00
|
|
|
Column {
|
2020-12-15 01:16:49 +00:00
|
|
|
Opaque.Label {
|
2020-07-08 22:30:15 +00:00
|
|
|
id: settingLabel
|
|
|
|
width: container.gridWidth
|
2020-12-15 01:16:49 +00:00
|
|
|
header: true
|
2020-09-03 22:40:44 +00:00
|
|
|
visible: text != ""
|
2020-07-08 22:30:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-15 01:16:49 +00:00
|
|
|
Opaque.Label {
|
2020-07-08 22:30:15 +00:00
|
|
|
id: settingDescriptionLabel
|
|
|
|
width: container.gridWidth
|
2020-12-15 01:16:49 +00:00
|
|
|
size: Theme.textSmallPt
|
2020-07-08 22:30:15 +00:00
|
|
|
visible: settingDescriptionLabel.text != ""
|
|
|
|
topPadding:10
|
|
|
|
}
|
2020-05-26 22:11:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: fieldContainer
|
|
|
|
width: container.gridWidth
|
|
|
|
// needs a height so !inline HLine "knows" how far down to be
|
|
|
|
height: fieldContainer.children[0].height
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-15 01:16:49 +00:00
|
|
|
Opaque.HLine {
|
|
|
|
width: parent.width - 20
|
|
|
|
visible: !last
|
|
|
|
}
|
2020-05-26 22:11:43 +00:00
|
|
|
}
|