2024-04-02 01:45:48 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
property string icon: ""
|
|
|
|
|
|
|
|
id: box
|
2024-04-03 23:51:08 +00:00
|
|
|
model: ["wallet", "coin", "paper"]
|
2024-04-02 01:45:48 +00:00
|
|
|
delegate: MenuItem {
|
|
|
|
required property string modelData
|
|
|
|
required property int index
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
highlighted: box.highlightedIndex === index
|
|
|
|
contentItem: View {
|
|
|
|
icon: modelData
|
|
|
|
}
|
|
|
|
}
|
|
|
|
contentItem: View {
|
2024-04-05 16:17:24 +00:00
|
|
|
icon: box.icon
|
2024-04-02 01:45:48 +00:00
|
|
|
padding: 5
|
|
|
|
}
|
|
|
|
|
2024-04-05 16:17:24 +00:00
|
|
|
onActivated: index => box.icon = model[index]
|
|
|
|
|
2024-04-02 01:45:48 +00:00
|
|
|
component View: Row {
|
|
|
|
required property string icon
|
|
|
|
|
|
|
|
spacing: 5
|
2024-04-03 23:51:08 +00:00
|
|
|
Icon {
|
2024-04-02 01:45:48 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2024-04-03 23:51:08 +00:00
|
|
|
iconName: icon
|
2024-04-07 20:07:52 +00:00
|
|
|
color: label.color
|
2024-04-02 01:45:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
2024-04-07 20:07:52 +00:00
|
|
|
id: label
|
2024-04-02 01:45:48 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
text: icon
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|