2021-01-20 16:24:21 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import "../../imports"
|
|
|
|
import "../../shared"
|
|
|
|
import "../../shared/status"
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: control
|
|
|
|
property string selectedColor
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Account color"
|
|
|
|
property string label: qsTrId("account-color")
|
2021-01-20 16:24:21 +00:00
|
|
|
property var model
|
2021-01-28 11:38:34 +00:00
|
|
|
height: childrenRect.height
|
2021-01-20 16:24:21 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: label
|
|
|
|
text: control.label
|
|
|
|
font.weight: Font.Medium
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
font.pixelSize: 13
|
|
|
|
height: 18
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: colors
|
|
|
|
spacing: 6
|
|
|
|
anchors.top: label.bottom
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
Repeater {
|
|
|
|
model: control.model
|
|
|
|
Item {
|
|
|
|
height: colorBtn.height
|
|
|
|
width: colorBtn.width
|
|
|
|
StatusWalletColorButton {
|
|
|
|
id: colorBtn
|
|
|
|
icon.color: modelData
|
|
|
|
selected: control.selectedColor.toUpperCase() == modelData.toUpperCase()
|
|
|
|
onClicked: {
|
|
|
|
control.selectedColor = modelData.toUpperCase()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|