mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
3a538acb1e
This is a new form control component to select colors for wallet accounts. It will replace the currently used `ColorSelect` in the Status Desktop application so it aligns with the new designs. Closes #1497
50 lines
1.2 KiB
QML
50 lines
1.2 KiB
QML
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
|
|
property string label: qsTr("Account color")
|
|
property var model
|
|
height: chilrenRect.height
|
|
|
|
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()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|