You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.6 KiB

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1
import QtQuick.Window 2.0
import "."
Dialog {
id: stateListContainer
modality: Qt.WindowModal
width: 640
height: 480
visible: false
contentItem: Rectangle {
anchors.fill: parent
ColumnLayout
{
anchors.fill: parent
10 years ago
anchors.margins: 10
TableView {
id: list
Layout.fillHeight: true
Layout.fillWidth: true
model: projectModel.stateListModel
itemDelegate: renderDelegate
headerDelegate: null
frameVisible: false
TableViewColumn {
role: "title"
title: qsTr("Scenario")
width: list.width
}
}
Row{
spacing: 5
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: 10
Button {
action: closeAction
}
}
}
}
Component {
id: renderDelegate
Item {
RowLayout {
anchors.fill: parent
Text {
Layout.fillWidth: true
Layout.fillHeight: true
text: styleData.value
font.pointSize: StateStyle.general.basicFontSize
verticalAlignment: Text.AlignBottom
}
ToolButton {
10 years ago
text: qsTr("Edit Genesis");
Layout.fillHeight: true
onClicked: list.model.editState(styleData.row);
}
ToolButton {
visible: list.model.defaultStateIndex !== styleData.row
text: qsTr("Delete");
Layout.fillHeight: true
onClicked: list.model.deleteState(styleData.row);
}
}
}
}
Row
{
Action {
id: closeAction
text: qsTr("Close")
onTriggered: stateListContainer.close();
}
}
}