|
|
> :warning: **The API is not stable!** If you are using this with external applications, please note that the API at this time is bound to change!
|
|
|
|
|
|
Plasma Mobile provides support for "quick settings" in the pull-down top panel, allowing users to quickly toggle settings without opening a settings application.
|
|
|
|
|
|
Examples can be seen here: https://invent.kde.org/plasma/plasma-mobile/-/tree/master/quicksettings
|
|
|
|
|
|
To create a new quick setting, you must create a **[KPackage](https://api.kde.org/frameworks/kpackage/html/index.html)**, which will be installed to `/usr/share/plasma/quicksettings`.
|
|
|
|
|
|
```qml
|
|
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
|
|
|
|
|
MobileShell.QuickSetting {
|
|
|
text: i18n("WiFi") // Name of quick setting
|
|
|
icon: "network-flightmode-on" // icon that is shown in the quick setting
|
|
|
status: "" // description shown below name, leave blank for On/Off
|
|
|
enabled: false // whether the quick setting shows the "highlighted" style
|
|
|
|
|
|
function toggle() {
|
|
|
// this is triggered when the user presses the quick settings toggle
|
|
|
// put your logic here
|
|
|
}
|
|
|
}
|
|
|
|
|
|
``` |