diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-02 16:31:26 +0800 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-02 16:31:26 +0800 |
| commit | 24a3da813862623b3eec05ef5050ba715e08c684 (patch) | |
| tree | 1674c1be77e48befe6e877b421f799deca6c4475 /modules/bar/Content.qml | |
| parent | osd: fix text not updating during transition (diff) | |
| download | caelestia-shell-24a3da813862623b3eec05ef5050ba715e08c684.tar.gz caelestia-shell-24a3da813862623b3eec05ef5050ba715e08c684.tar.bz2 caelestia-shell-24a3da813862623b3eec05ef5050ba715e08c684.zip | |
feat: bar popouts
Create active window popout
Diffstat (limited to 'modules/bar/Content.qml')
| -rw-r--r-- | modules/bar/Content.qml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/bar/Content.qml b/modules/bar/Content.qml index ac828f8..7d91076 100644 --- a/modules/bar/Content.qml +++ b/modules/bar/Content.qml @@ -12,6 +12,18 @@ StyledRect { required property ShellScreen screen + function checkPopout(y: real): var { + const aw = activeWindow.child + const awy = activeWindow.y + aw.y + if (y >= awy && y <= awy + aw.implicitHeight) { + Popouts.currentName = "activewindow" + Popouts.currentCenter = Qt.binding(() => activeWindow.y + aw.y + aw.implicitHeight / 2); + Popouts.hasCurrent = true; + } else { + Popouts.hasCurrent = false; + } + } + anchors.top: parent.top anchors.bottom: parent.bottom @@ -21,6 +33,19 @@ StyledRect { Component.onCompleted: Visibilities.bars[screen] = this + MouseArea { + anchors.fill: parent + + hoverEnabled: true + + onPositionChanged: event => root.checkPopout(event.y) + + onContainsMouseChanged: { + if (!containsMouse) + Popouts.hasCurrent = false; + } + } + Item { id: child |