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
|
|
|
|
|
|
|
|
width: parent.width - 20
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
padding: 10
|
|
|
|
spacing: 10
|
|
|
|
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-09-03 22:40:44 +00:00
|
|
|
spacing: 10 * gcd.themeScale
|
|
|
|
padding: 10 * gcd.themeScale
|
2020-05-26 22:11:43 +00:00
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
2020-09-03 22:40:44 +00:00
|
|
|
property int gridWidth: inline ? (parent.width / 2) - (20 * gcd.themeScale) : parent.width - (20 * gcd.themeScale)
|
2020-05-26 22:11:43 +00:00
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
2020-07-08 22:30:15 +00:00
|
|
|
Column {
|
2020-07-25 16:44:47 +00:00
|
|
|
Opaque.ScalingLabel {
|
2020-07-08 22:30:15 +00:00
|
|
|
id: settingLabel
|
|
|
|
width: container.gridWidth
|
|
|
|
color: Theme.mainTextColor
|
|
|
|
size: Theme.secondaryTextSize * gcd.themeScale
|
|
|
|
font.weight: Font.Bold
|
2020-09-03 22:40:44 +00:00
|
|
|
visible: text != ""
|
2020-07-08 22:30:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Opaque.ScalingLabel {
|
|
|
|
id: settingDescriptionLabel
|
|
|
|
width: container.gridWidth
|
|
|
|
color: Theme.mainTextColor
|
|
|
|
size: Theme.chatMetaTextSize * gcd.themeScale
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Opaque.HLine { visible: !last }
|
|
|
|
}
|