38 lines
757 B
QML
38 lines
757 B
QML
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
|
|
|
|
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";
|
|
}
|
|
}
|