diff options
| author | Nippy <nippy@rp1.hu> | 2026-05-08 19:50:49 +0200 |
|---|---|---|
| committer | Nippy <nippy@rp1.hu> | 2026-05-08 19:50:49 +0200 |
| commit | 3462bcc46ecf74f576ea4397f16492c16bd75b10 (patch) | |
| tree | c5ab7aef4498647e057bda8d49c11e5f9dda74c9 /raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterDetailExample | |
| parent | 56616f693b4f263cbf0d47da43b67424efa6022d (diff) | |
| download | RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.tar.gz RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.zip | |
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterDetailExample')
2 files changed, 150 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterDetailExample/DetailExampleWidget.qml b/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterDetailExample/DetailExampleWidget.qml new file mode 100644 index 0000000..7d61900 --- /dev/null +++ b/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterDetailExample/DetailExampleWidget.qml @@ -0,0 +1,138 @@ +import QtQuick +import QtQuick.Controls +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 var options: pluginData.options || ["Option A", "Option B", "Option C"] + + ccWidgetIcon: isEnabled ? "settings" : "settings" + ccWidgetPrimaryText: "Detail Example" + ccWidgetSecondaryText: { + if (isEnabled) { + const selected = pluginData.selectedOption || "Option A" + return selected + } + return "Disabled" + } + ccWidgetIsActive: isEnabled + + onCcWidgetToggled: { + isEnabled = !isEnabled + if (pluginService) { + pluginService.savePluginData("controlCenterDetailExample", "isEnabled", isEnabled) + } + } + + ccDetailContent: Component { + Rectangle { + id: detailRoot + implicitHeight: detailColumn.implicitHeight + Theme.spacingM * 2 + radius: Theme.cornerRadius + color: Theme.surfaceContainerHigh + border.width: 0 + visible: true + + property var options: ["Option A", "Option B", "Option C"] + property string currentSelection: SettingsData.getPluginSetting("controlCenterDetailExample", "selectedOption", "Option A") + + Column { + id: detailColumn + anchors.fill: parent + anchors.margins: Theme.spacingM + spacing: Theme.spacingS + + StyledText { + text: "Detail Example Settings" + font.pixelSize: Theme.fontSizeLarge + color: Theme.surfaceText + font.weight: Font.Medium + } + + StyledText { + text: "Select an option below:" + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceVariantText + } + + Repeater { + model: detailRoot.options + + Rectangle { + width: parent.width + height: 40 + radius: Theme.cornerRadius + color: optionMouseArea.containsMouse ? Theme.surfaceContainerHighest : "transparent" + border.color: detailRoot.currentSelection === modelData ? Theme.primary : "transparent" + border.width: detailRoot.currentSelection === modelData ? 2 : 0 + + MouseArea { + id: optionMouseArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + z: 100 + onClicked: { + SettingsData.setPluginSetting("controlCenterDetailExample", "selectedOption", modelData) + detailRoot.currentSelection = modelData + PluginService.pluginDataChanged("controlCenterDetailExample") + ToastService.showInfo("Option Selected", modelData) + } + } + + Row { + anchors.fill: parent + anchors.leftMargin: Theme.spacingM + anchors.rightMargin: Theme.spacingM + spacing: Theme.spacingS + enabled: false + + DankIcon { + name: detailRoot.currentSelection === modelData ? "radio_button_checked" : "radio_button_unchecked" + color: detailRoot.currentSelection === modelData ? Theme.primary : Theme.surfaceVariantText + size: Theme.iconSize + anchors.verticalCenter: parent.verticalCenter + } + + StyledText { + text: modelData + color: detailRoot.currentSelection === modelData ? Theme.primary : Theme.surfaceText + font.pixelSize: Theme.fontSizeMedium + anchors.verticalCenter: parent.verticalCenter + } + } + } + } + } + } + } + + horizontalBarPill: Component { + Row { + spacing: Theme.spacingXS + + DankIcon { + name: root.isEnabled ? "settings" : "settings_off" + color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText + font.pixelSize: Theme.iconSize - 4 + anchors.verticalCenter: parent.verticalCenter + } + + StyledText { + text: { + const selected = root.pluginData.selectedOption || "Option A" + return selected.substring(0, 1) + } + color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText + font.pixelSize: Theme.fontSizeMedium + anchors.verticalCenter: parent.verticalCenter + } + } + } +} diff --git a/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterDetailExample/plugin.json b/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterDetailExample/plugin.json new file mode 100644 index 0000000..00fc9f9 --- /dev/null +++ b/raveos-hyprland-theme/theme-data/dms/PLUGINS/ControlCenterDetailExample/plugin.json @@ -0,0 +1,12 @@ +{ + "id": "controlCenterDetailExample", + "name": "CC Detail Example", + "description": "Example plugin with Control Center detail dropdown", + "version": "1.0.0", + "author": "DankMaterialShell", + "type": "widget", + "capabilities": ["control-center"], + "component": "./DetailExampleWidget.qml", + "icon": "settings", + "permissions": ["settings_read", "settings_write"] +} |