summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample
diff options
context:
space:
mode:
authorNippy <nippy@rp1.hu>2026-05-08 19:50:49 +0200
committerNippy <nippy@rp1.hu>2026-05-08 19:50:49 +0200
commit3462bcc46ecf74f576ea4397f16492c16bd75b10 (patch)
treec5ab7aef4498647e057bda8d49c11e5f9dda74c9 /raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample
parent56616f693b4f263cbf0d47da43b67424efa6022d (diff)
downloadRaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.tar.gz
RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.zip
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample')
-rw-r--r--raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample/ControlCenterExampleWidget.qml68
-rw-r--r--raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample/plugin.json12
2 files changed, 80 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample/ControlCenterExampleWidget.qml b/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample/ControlCenterExampleWidget.qml
new file mode 100644
index 0000000..450d538
--- /dev/null
+++ b/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample/ControlCenterExampleWidget.qml
@@ -0,0 +1,68 @@
+import QtQuick
+import Quickshell
+import qs.Common
+import qs.Services
+import qs.Widgets
+import qs.Modules.Plugins
+
+PluginComponent {
+ id: root
+
+ property bool isEnabled: pluginData.isEnabled || false
+ property int clickCount: pluginData.clickCount || 0
+
+ ccWidgetIcon: isEnabled ? "toggle_on" : "toggle_off"
+ ccWidgetPrimaryText: "Example Toggle"
+ ccWidgetSecondaryText: isEnabled ? `Active • ${clickCount} clicks` : "Inactive"
+ ccWidgetIsActive: isEnabled
+
+ onCcWidgetToggled: {
+ isEnabled = !isEnabled
+ clickCount += 1
+ if (pluginService) {
+ pluginService.savePluginData("controlCenterExample", "isEnabled", isEnabled)
+ pluginService.savePluginData("controlCenterExample", "clickCount", clickCount)
+ }
+ ToastService.showInfo("Example Toggle", isEnabled ? "Activated!" : "Deactivated!")
+ }
+
+ horizontalBarPill: Component {
+ Row {
+ spacing: Theme.spacingXS
+
+ DankIcon {
+ name: root.isEnabled ? "toggle_on" : "toggle_off"
+ color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
+ font.pixelSize: Theme.iconSize - 4
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ StyledText {
+ text: `${root.clickCount}`
+ color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
+ font.pixelSize: Theme.fontSizeMedium
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+ }
+
+ verticalBarPill: Component {
+ Column {
+ spacing: Theme.spacingXS
+
+ DankIcon {
+ name: root.isEnabled ? "toggle_on" : "toggle_off"
+ color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
+ font.pixelSize: Theme.iconSize - 4
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ StyledText {
+ text: `${root.clickCount}`
+ color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
+ font.pixelSize: Theme.fontSizeSmall
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ }
+}
diff --git a/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample/plugin.json b/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample/plugin.json
new file mode 100644
index 0000000..f573ae6
--- /dev/null
+++ b/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterExample/plugin.json
@@ -0,0 +1,12 @@
+{
+ "id": "controlCenterExample",
+ "name": "CC Toggle Example",
+ "description": "Example plugin with Control Center toggle widget",
+ "version": "1.0.0",
+ "author": "DankMaterialShell",
+ "type": "widget",
+ "capabilities": ["control-center"],
+ "component": "./ControlCenterExampleWidget.qml",
+ "icon": "toggle_on",
+ "permissions": ["settings_read", "settings_write"]
+}