2023-04-09 13:35:35 +08:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-09-14 13:01:10 +08:00
|
|
|
import QtQuick
|
2023-03-20 20:15:24 +08:00
|
|
|
import QtQuick.Layouts
|
2022-04-02 15:11:13 +08:00
|
|
|
import ".."
|
|
|
|
|
|
|
|
GraphicsBox {
|
2022-04-30 15:27:56 +08:00
|
|
|
property var options: []
|
|
|
|
property string skill_name: ""
|
|
|
|
property int result
|
2022-04-02 15:11:13 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
id: root
|
2022-05-01 18:37:13 +08:00
|
|
|
title.text: Backend.translate("$Choice").arg(Backend.translate(skill_name))
|
2022-04-30 15:27:56 +08:00
|
|
|
width: Math.max(140, body.width + 20)
|
|
|
|
height: body.height + title.height + 20
|
2022-04-02 15:11:13 +08:00
|
|
|
|
2023-03-20 20:15:24 +08:00
|
|
|
GridLayout {
|
2022-04-30 15:27:56 +08:00
|
|
|
id: body
|
|
|
|
x: 10
|
|
|
|
y: title.height + 5
|
2023-03-20 20:15:24 +08:00
|
|
|
flow: GridLayout.TopToBottom
|
|
|
|
rows: 8
|
|
|
|
columnSpacing: 10
|
2022-04-02 15:11:13 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
Repeater {
|
|
|
|
model: options
|
2022-04-02 15:11:13 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
MetroButton {
|
2023-03-20 20:15:24 +08:00
|
|
|
Layout.fillWidth: true
|
2022-05-01 18:37:13 +08:00
|
|
|
text: Backend.translate(modelData)
|
2022-04-02 15:11:13 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
onClicked: {
|
|
|
|
result = index;
|
|
|
|
root.close();
|
2022-04-02 15:11:13 +08:00
|
|
|
}
|
2022-04-30 15:27:56 +08:00
|
|
|
}
|
2022-04-02 15:11:13 +08:00
|
|
|
}
|
2022-04-30 15:27:56 +08:00
|
|
|
}
|
2022-04-02 15:11:13 +08:00
|
|
|
}
|