dock: pinned mode acts as screen split - bar shrinks, corners adjust, opaque background
This commit is contained in:
parent
c22eb51dcd
commit
f501f977d1
9 changed files with 52 additions and 21 deletions
38
shell/services/DockState.qml
Normal file
38
shell/services/DockState.qml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
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";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue