Commit 78ab0453 authored by Leander Schulten's avatar Leander Schulten

UI: ProgramPrototypeView: Use Popups instead of Dialogs. See #57

parent c9ae6c8b
......@@ -2,7 +2,6 @@ import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12
import QtQuick.Dialogs 1.3
import custom.licht 1.0
import "components"
......@@ -116,60 +115,54 @@ ModelView{
Dialog{
modality: Qt.WindowModal
Popup{
modal: true
id:dialog
title: "Hallo"
width:300
contentItem: RowLayout {
Pane{
x: (parent.width - width) / 2
y: (parent.height - height) / 2
contentItem: ColumnLayout{
spacing: 10
ComboBox{
Layout.fillWidth: true
ColumnLayout{
anchors.left: parent.left
anchors.right: parent.right
spacing: 10
ComboBox{
Layout.fillWidth: true
id:prototype
model: devicePrototypeModel
textRole: "display"
}
RowLayout{
Label{
id:nameLabel
text:"Name :"
}
TextInputField{
Layout.fillWidth: true
id:name
}
}
RowLayout{
Label{
text:"Description :"
}
TextInputField{
Layout.fillWidth: true
id:description
}
}
RowLayout{
Button{
Layout.fillWidth: true
text:"Abbrechen"
onClicked: dialog.visible = false
}
Button{
Layout.fillWidth: true
text:"Erzeugen"
onClicked: {
if(name.text===""){
name.underlineColor = "red";
}else{
dialog.visible = false;
ModelManager.addProgrammPrototype(prototype.currentIndex,name.text,description.text);
}
}
id:prototype
model: devicePrototypeModel
textRole: "display"
}
RowLayout{
Label{
id:nameLabel
text:"Name :"
}
TextInputField{
Layout.fillWidth: true
id:name
}
}
RowLayout{
Label{
text:"Description :"
}
TextInputField{
Layout.fillWidth: true
id:description
}
}
RowLayout{
Button{
Layout.fillWidth: true
text:"Abbrechen"
onClicked: dialog.visible = false
}
Button{
Layout.fillWidth: true
text:"Erzeugen"
onClicked: {
if(name.text===""){
name.underlineColor = "red";
}else{
dialog.visible = false;
ModelManager.addProgrammPrototype(prototype.currentIndex,name.text,description.text);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment