diff options
Diffstat (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/PLUGINS/ControlCenterExample')
2 files changed, 80 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/PLUGINS/ControlCenterExample/ControlCenterExampleWidget.qml b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/PLUGINS/ControlCenterExample/ControlCenterExampleWidget.qml new file mode 100644 index 0000000..450d538 --- /dev/null +++ b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/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/DankMaterialShell/quickshell/PLUGINS/ControlCenterExample/plugin.json b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/PLUGINS/ControlCenterExample/plugin.json new file mode 100644 index 0000000..f573ae6 --- /dev/null +++ b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/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"] +} |