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/Widgets/DankCollapsibleSection.qml | |
| parent | 56616f693b4f263cbf0d47da43b67424efa6022d (diff) | |
| download | RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.tar.gz RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.zip | |
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/dms/Widgets/DankCollapsibleSection.qml')
| -rw-r--r-- | raveos-hyprland-theme/theme-data/dms/Widgets/DankCollapsibleSection.qml | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/dms/Widgets/DankCollapsibleSection.qml b/raveos-hyprland-theme/theme-data/dms/Widgets/DankCollapsibleSection.qml new file mode 100644 index 0000000..0ed0e59 --- /dev/null +++ b/raveos-hyprland-theme/theme-data/dms/Widgets/DankCollapsibleSection.qml @@ -0,0 +1,130 @@ +import QtQuick +import QtQuick.Layouts +import qs.Common +import qs.Widgets + +ColumnLayout { + id: root + + required property string title + property string description: "" + property bool expanded: false + property bool showBackground: false + property alias headerColor: headerRect.color + + signal toggleRequested + + spacing: Theme.spacingS + Layout.fillWidth: true + + Rectangle { + id: headerRect + Layout.fillWidth: true + Layout.preferredHeight: Math.max(titleRow.implicitHeight + Theme.paddingM * 2, 48) + radius: Theme.cornerRadius + color: "transparent" + + RowLayout { + id: titleRow + anchors.fill: parent + anchors.leftMargin: Theme.paddingM + anchors.rightMargin: Theme.paddingM + spacing: Theme.spacingM + + StyledText { + text: root.title + font.pixelSize: Theme.fontSizeLarge + font.weight: Font.Medium + Layout.fillWidth: true + } + + DankIcon { + name: "expand_more" + size: Theme.iconSizeSmall + rotation: root.expanded ? 180 : 0 + + Behavior on rotation { + enabled: Theme.currentAnimationSpeed !== SettingsData.AnimationSpeed.None + DankAnim { + duration: Theme.shortDuration + easing.bezierCurve: Theme.expressiveCurves.standard + } + } + } + } + + StateLayer { + anchors.fill: parent + onClicked: { + root.toggleRequested(); + root.expanded = !root.expanded; + } + } + } + + default property alias content: contentColumn.data + + Item { + id: contentWrapper + Layout.fillWidth: true + Layout.preferredHeight: root.expanded ? (contentColumn.implicitHeight + Theme.spacingS * 2) : 0 + clip: true + + Behavior on Layout.preferredHeight { + enabled: Theme.currentAnimationSpeed !== SettingsData.AnimationSpeed.None + DankAnim { + duration: Theme.expressiveDurations.expressiveDefaultSpatial + easing.bezierCurve: Theme.expressiveCurves.standard + } + } + + Rectangle { + id: backgroundRect + anchors.fill: parent + radius: Theme.cornerRadius + color: Theme.surfaceContainer + opacity: root.showBackground && root.expanded ? 1.0 : 0.0 + visible: root.showBackground + + Behavior on opacity { + enabled: Theme.currentAnimationSpeed !== SettingsData.AnimationSpeed.None + DankAnim { + duration: Theme.shortDuration + easing.bezierCurve: Theme.expressiveCurves.standard + } + } + } + + ColumnLayout { + id: contentColumn + anchors.left: parent.left + anchors.right: parent.right + y: Theme.spacingS + anchors.leftMargin: Theme.paddingM + anchors.rightMargin: Theme.paddingM + anchors.bottomMargin: Theme.spacingS + spacing: Theme.spacingS + opacity: root.expanded ? 1.0 : 0.0 + + Behavior on opacity { + enabled: Theme.currentAnimationSpeed !== SettingsData.AnimationSpeed.None + DankAnim { + duration: Theme.shortDuration + easing.bezierCurve: Theme.expressiveCurves.standard + } + } + + StyledText { + id: descriptionText + Layout.fillWidth: true + Layout.topMargin: root.description !== "" ? Theme.spacingXS : 0 + Layout.bottomMargin: root.description !== "" ? Theme.spacingS : 0 + visible: root.description !== "" + text: root.description + color: Theme.surfaceTextSecondary + font.pixelSize: Theme.fontSizeSmall + wrapMode: Text.Wrap + } + } + } +} |