From 7af67098b4bce76334fbd63326532674d1443077 Mon Sep 17 00:00:00 2001 From: Chris Holland Date: Wed, 13 Mar 2024 01:41:53 -0400 Subject: [PATCH] Port to Plasma6 Plasmoid.contextualActions --- package/contents/ui/main.qml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index 66dd472..60c5c29 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -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 } @@ -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() } }