C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 20s
JS/TS / lint (pull_request) Successful in 22s
Python / static (pull_request) Successful in 57s
Rust / fmt (pull_request) Successful in 1m2s
C++ / build (pull_request) Successful in 2m10s
Rust / build (pull_request) Successful in 1m50s
Rust / clippy (pull_request) Successful in 1m25s
Python / verify (pull_request) Successful in 2m58s
C++ / clang-tidy (pull_request) Successful in 7m8s
106 lines
2.0 KiB
QML
106 lines
2.0 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import Quickshell
|
|
import QtQuick
|
|
import qs.Components
|
|
import qs.Helpers
|
|
import ZShell.Config
|
|
import qs.Daemons
|
|
|
|
Item {
|
|
id: root
|
|
|
|
required property var drawing
|
|
property bool expanded: true
|
|
property real offsetScale: shouldBeActive ? 0 : 1
|
|
property bool pinned: false
|
|
required property ShellScreen screen
|
|
readonly property bool shouldBeActive: visibilities.isDrawing
|
|
required property var visibilities
|
|
|
|
function collapse(): void {
|
|
if (pinned)
|
|
return;
|
|
|
|
expanded = false;
|
|
}
|
|
|
|
function expand(): void {
|
|
expanded = true;
|
|
}
|
|
|
|
function toggleExpanded(): void {
|
|
if (pinned)
|
|
return;
|
|
|
|
expanded = !expanded;
|
|
}
|
|
|
|
function togglePinned(): void {
|
|
pinned = !pinned;
|
|
}
|
|
|
|
anchors.leftMargin: (-implicitWidth - 5) * offsetScale
|
|
implicitHeight: content.implicitHeight
|
|
implicitWidth: root.expanded ? content.implicitWidth : icon.implicitWidth
|
|
opacity: 1 - offsetScale
|
|
visible: offsetScale < 1
|
|
|
|
Behavior on implicitWidth {
|
|
Anim {
|
|
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
|
easing: Tokens.anim.expressiveDefaultSpatial
|
|
}
|
|
}
|
|
Behavior on offsetScale {
|
|
Anim {
|
|
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
|
easing: Tokens.anim.expressiveDefaultSpatial
|
|
}
|
|
}
|
|
|
|
onVisibleChanged: {
|
|
if (!visible)
|
|
root.expanded = true;
|
|
}
|
|
|
|
Loader {
|
|
id: icon
|
|
|
|
active: (root.shouldBeActive || root.visible) && opacity > 0
|
|
anchors.right: parent.right
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
asynchronous: true
|
|
opacity: root.expanded ? 0 : 1
|
|
|
|
Behavior on opacity {
|
|
Anim {
|
|
}
|
|
}
|
|
sourceComponent: MaterialIcon {
|
|
font.pointSize: Tokens.font.size.larger
|
|
text: "arrow_forward_ios"
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
id: content
|
|
|
|
active: (root.shouldBeActive || root.visible) && opacity > 0
|
|
anchors.right: parent.right
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
asynchronous: true
|
|
opacity: root.expanded ? 1 : 0
|
|
|
|
Behavior on opacity {
|
|
Anim {
|
|
}
|
|
}
|
|
sourceComponent: Content {
|
|
drawing: root.drawing
|
|
visibilities: root.visibilities
|
|
wrapper: root
|
|
}
|
|
}
|
|
}
|