FreeKill/Fk/RoomElement/ViewPile.qml
notify 9a9fc9c105
UI (#290)
杀光侧栏 只留战报一个
Qml标记,以及一个割圆demo
自由选将增加搜索功能
room:setBanner,相当于公共标记了,客户端可以Fk:currentRoom():getBanner拿(当然服务端也可)
改掉两个很蠢的命名
2023-12-06 21:07:35 +08:00

48 lines
1017 B
QML

// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Layouts
ColumnLayout {
id: root
anchors.fill: parent
property var extra_data: ({})
signal finish()
BigGlowText {
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height + 4
text: Backend.translate(extra_data.name)
}
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) {
data = JSON.parse(Backend.callLuaFunction("GetCardData", [modelData]));
} else {
data.cid = 0;
data.name = modelData;
data.suit = '';
data.number = 0;
data.color = '';
}
setData(data);
}
}
}
}