2023-04-09 05:35:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
import QtQuick
|
2023-04-04 08:25:37 +00:00
|
|
|
import QtQuick.Layouts
|
2023-02-21 05:44:24 +00:00
|
|
|
|
2023-12-06 13:07:35 +00:00
|
|
|
ColumnLayout {
|
2023-02-21 05:44:24 +00:00
|
|
|
id: root
|
|
|
|
anchors.fill: parent
|
|
|
|
property var extra_data: ({})
|
|
|
|
signal finish()
|
|
|
|
|
2023-12-06 13:07:35 +00:00
|
|
|
BigGlowText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: childrenRect.height + 4
|
2023-04-04 08:25:37 +00:00
|
|
|
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr(extra_data.name)
|
2023-12-06 13:07:35 +00:00
|
|
|
}
|
2023-04-04 08:25:37 +00:00
|
|
|
|
2023-12-06 13:07:35 +00:00
|
|
|
GridView {
|
|
|
|
cellWidth: 93 + 4
|
|
|
|
cellHeight: 130 + 4
|
|
|
|
Layout.preferredWidth: root.width - root.width % 97
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
model: extra_data.ids || extra_data.cardNames
|
|
|
|
|
|
|
|
delegate: CardItem {
|
|
|
|
id: cardItem
|
|
|
|
autoBack: false
|
|
|
|
Component.onCompleted: {
|
|
|
|
let data = {}
|
|
|
|
if (extra_data.ids) {
|
2024-01-24 19:23:29 +00:00
|
|
|
data = lcall("GetCardData", modelData);
|
2023-12-06 13:07:35 +00:00
|
|
|
} else {
|
|
|
|
data.cid = 0;
|
|
|
|
data.name = modelData;
|
|
|
|
data.suit = '';
|
|
|
|
data.number = 0;
|
|
|
|
data.color = '';
|
2023-04-04 08:25:37 +00:00
|
|
|
}
|
2023-12-06 13:07:35 +00:00
|
|
|
setData(data);
|
2023-04-04 08:25:37 +00:00
|
|
|
}
|
|
|
|
}
|
2023-02-21 05:44:24 +00:00
|
|
|
}
|
|
|
|
}
|