Show a conformation message after a successful manage action

Contributes to: CURA-8587
This commit is contained in:
Jelle Spijker 2021-12-07 12:23:04 +01:00
parent 1c0e484069
commit ca76bcc29c
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
4 changed files with 91 additions and 22 deletions

View file

@ -15,6 +15,8 @@ RowLayout
property alias secondaryText: secondaryButton.text
property string busyPrimaryText: busyMessageText.text
property string busySecondaryText: busyMessageText.text
property string confirmedPrimaryText: confirmedMessageText.text
property string confirmedSecondaryText: confirmedMessageText.text
property bool enabled: true
property bool busy: state == "busy"
@ -28,7 +30,8 @@ RowLayout
onClicked:
{
busyMessageText.text = manageButton.busyPrimaryText
busyMessage.text = manageButton.busyPrimaryText
confirmedMessage.text = manageButton.confirmedPrimaryText
manageButton.clicked(true)
}
}
@ -41,7 +44,8 @@ RowLayout
onClicked:
{
busyMessageText.text = manageButton.busySecondaryText
busyMessage.text = manageButton.busySecondaryText
confirmedMessage.text = manageButton.confirmedSecondaryText
manageButton.clicked(false)
}
}
@ -50,6 +54,7 @@ RowLayout
{
id: busyMessage
visible: false
property alias text: busyMessageText.text
height: UM.Theme.getSize("action_button").height
width: childrenRect.width
@ -90,6 +95,26 @@ RowLayout
}
}
Item
{
id: confirmedMessage
property alias text: confirmedMessageText.text
visible: false
height: UM.Theme.getSize("action_button").height
width: childrenRect.width
Label
{
id: confirmedMessageText
visible: parent.visble
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.getFont("medium_bold")
color: UM.Theme.getColor("primary")
}
}
states:
[
State
@ -110,6 +135,11 @@ RowLayout
target: busyMessage
visible: false
}
PropertyChanges
{
target: confirmedMessage
visible: false
}
},
State
{
@ -129,6 +159,11 @@ RowLayout
target: busyMessage
visible: false
}
PropertyChanges
{
target: confirmedMessage
visible: false
}
},
State
{
@ -157,6 +192,35 @@ RowLayout
target: busyMessage
visible: manageButton.visible
}
PropertyChanges
{
target: confirmedMessage
visible: false
}
},
State
{
name: "confirmed"
PropertyChanges
{
target: primaryButton
visible: false
}
PropertyChanges
{
target: secondaryButton
visible: false
}
PropertyChanges
{
target: busyMessage
visible: false
}
PropertyChanges
{
target: confirmedMessage
visible: manageButton.visible
}
}
]
}