FreeKill/qml/Pages/RoomElement/PhotoElement/RoleComboBox.qml

47 lines
869 B
QML
Raw Normal View History

// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import "../../skin-bank.js" as SkinBank
Image {
property string value: "unknown"
property var options: ["unknown", "loyalist", "rebel", "renegade"]
id: root
source: visible ? SkinBank.ROLE_DIR + value : ""
visible: value != "hidden"
Image {
property string value: "unknown"
id: assumptionBox
source: SkinBank.ROLE_DIR + value
visible: root.value == "unknown"
2023-03-18 15:34:42 +08:00
TapHandler {
onTapped: optionPopupBox.visible = true;
}
}
Column {
id: optionPopupBox
visible: false
spacing: 2
Repeater {
model: options
Image {
source: SkinBank.ROLE_DIR + modelData
2023-03-18 15:34:42 +08:00
TapHandler {
onTapped: {
optionPopupBox.visible = false;
assumptionBox.value = modelData;
}
}
}
}
}
}