Skip to content

Commit

Permalink
Port to Plasma6 Plasmoid.contextualActions
Browse files Browse the repository at this point in the history
  • Loading branch information
Zren committed Mar 13, 2024
1 parent 60047eb commit 7af6709
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions package/contents/ui/main.qml
Expand Up @@ -31,7 +31,7 @@ PlasmoidItem {
anchors.centerIn: parent
visible: weatherData.needsConfiguring
text: i18nd("plasma_applet_org.kde.plasma.weather", "Set location…")
onClicked: plasmoid.action("configure").trigger()
onClicked: Plasmoid.internalAction("configure").trigger()
Layout.minimumWidth: implicitWidth
Layout.minimumHeight: implicitHeight
}
Expand All @@ -44,13 +44,15 @@ PlasmoidItem {

}

function action_refresh() {
weatherData.refresh()
}
Plasmoid.contextualActions: [
PlasmaCore.Action {
text: i18n("Refresh")
icon.name: "view-refresh"
onTriggered: weatherData.refresh()
}
]

Component.onCompleted: {
plasmoid.setAction("refresh", i18n("Refresh"), "view-refresh")

// plasmoid.action("configure").trigger()
Plasmoid.internalAction("configure").trigger()
}
}

0 comments on commit 7af6709

Please sign in to comment.