Commit 3ab26918 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Use an action button when on the phone

parent 658ffe2b
......@@ -123,8 +123,16 @@ DiscoverPage {
Layout.fillWidth: true
}
Binding {
target: appInfo.actions
property: "main"
value: appbutton.action
}
InstallApplicationButton {
id: appbutton
application: appInfo.application
visible: applicationWindow().wideScreen
}
Button {
......
......@@ -19,12 +19,21 @@ ConditionalLoader
id: listener
}
property QtObject action: Kirigami.Action {
text: root.text
iconName: application.isInstalled ? "kalgebra" : "system-software-install"
visible: !listener.isActive && !applicationWindow().wideScreen
onTriggered: root.click()
}
function click() {
if (!isActive) {
if(application.isInstalled)
ResourcesModel.removeApplication(application);
else
ResourcesModel.installApplication(application);
} else {
console.warn("trying to un/install but resouce still active", application.name)
}
}
......
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