Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 84137f97 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Include a cancel button on the application page

BUG: 401776
parent e3b49c44
......@@ -80,14 +80,17 @@ DiscoverPage {
}
}
Kirigami.Action {
id: invokeAction
visible: application.isInstalled && application.canExecute && !appbutton.isActive
text: application.executeLabel
icon.name: "media-playback-start"
onTriggered: application.invokeApplication()
}
actions {
main: appbutton.action
right: Kirigami.Action {
visible: application.isInstalled && application.canExecute && !appbutton.isActive
text: application.executeLabel
icon.name: "media-playback-start"
onTriggered: application.invokeApplication()
}
right: appbutton.isActive ? appbutton.cancelAction : invokeAction
}
InstallApplicationButton {
......
......@@ -18,7 +18,7 @@ ConditionalLoader
id: listener
}
property QtObject action: Kirigami.Action {
readonly property QtObject action: Kirigami.Action {
text: root.text
icon {
name: application.isInstalled ? "trash-empty" : "cloud-download"
......@@ -27,6 +27,13 @@ ConditionalLoader
enabled: !listener.isActive
onTriggered: root.click()
}
readonly property QtObject cancelAction: Kirigami.Action {
text: i18n("Cancel")
icon.name: "dialog-cancel"
visible: listener.isActive
enabled: listener.isCancellable
onTriggered: listener.cancel()
}
function click() {
if (!isActive) {
......@@ -43,9 +50,7 @@ ConditionalLoader
componentTrue: RowLayout {
ToolButton {
Layout.fillHeight: true
icon.name: "dialog-cancel"
enabled: listener.isCancellable
onClicked: listener.cancel()
action: root.cancelAction
}
LabelBackground {
......
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