pragma Singleton import QtQuick QtObject { // "closed" | "pinned" | "overlay" property string mode: "closed" readonly property bool open: mode !== "closed" // Screen space reserved by the dock when pinned. // Bar, screen corners, etc. read this to adjust layout. property int reservedWidth: 0 // Animated version for smooth visual transitions. // Consumers that need coordinated movement use this instead. property int reservedWidthAnimated: 0 Behavior on reservedWidthAnimated { NumberAnimation { duration: 200 easing.type: Easing.InOutCubic } } onReservedWidthChanged: reservedWidthAnimated = reservedWidth onModeChanged: { if (mode !== "pinned") reservedWidth = 0; } function openPinned() { mode = "pinned"; } function openOverlay() { if (mode === "closed") mode = "overlay"; } function close() { mode = "closed"; } function toggle() { if (mode === "pinned") mode = "closed"; else mode = "pinned"; } }