diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-04 17:29:53 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-04 17:29:53 +1000 |
| commit | be9666457c7a1c66dc355c0bd5c44188a8eec206 (patch) | |
| tree | 0cb2d340cb13bcb98a5e1676ccf4e6764e7dde9a | |
| parent | feat: bar battery popout (diff) | |
| download | caelestia-shell-be9666457c7a1c66dc355c0bd5c44188a8eec206.tar.gz caelestia-shell-be9666457c7a1c66dc355c0bd5c44188a8eec206.tar.bz2 caelestia-shell-be9666457c7a1c66dc355c0bd5c44188a8eec206.zip | |
bar: ensure popouts fully on screen
Also round the other way if touching edge
| -rw-r--r-- | modules/bar/popouts/Background.qml | 6 | ||||
| -rw-r--r-- | modules/drawers/Backgrounds.qml | 1 | ||||
| -rw-r--r-- | modules/drawers/Panels.qml | 8 |
3 files changed, 12 insertions, 3 deletions
diff --git a/modules/bar/popouts/Background.qml b/modules/bar/popouts/Background.qml index dd76af8..6dafaff 100644 --- a/modules/bar/popouts/Background.qml +++ b/modules/bar/popouts/Background.qml @@ -7,6 +7,7 @@ ShapePath { id: root required property Wrapper wrapper + required property bool invertBottomRounding readonly property real rounding: BorderConfig.rounding readonly property bool flatten: wrapper.width < rounding * 2 readonly property real roundingX: flatten ? wrapper.width / 2 : rounding @@ -36,13 +37,14 @@ ShapePath { relativeY: root.wrapper.height - root.rounding * 4 } PathArc { - relativeX: -root.roundingX + relativeX: root.invertBottomRounding ? root.roundingX : -root.roundingX relativeY: root.rounding radiusX: Math.min(root.rounding, root.wrapper.width) radiusY: root.rounding + direction: root.invertBottomRounding ? PathArc.Counterclockwise : PathArc.Clockwise } PathLine { - relativeX: -(root.wrapper.width - root.roundingX * 2) + relativeX: -(root.wrapper.width - root.roundingX * (root.invertBottomRounding ? 0 : 2)) relativeY: 0 } PathArc { diff --git a/modules/drawers/Backgrounds.qml b/modules/drawers/Backgrounds.qml index d4ea1d7..3dcc8ad 100644 --- a/modules/drawers/Backgrounds.qml +++ b/modules/drawers/Backgrounds.qml @@ -55,6 +55,7 @@ Shape { BarPopouts.Background { wrapper: panels.popouts + invertBottomRounding: wrapper.y + wrapper.height - BorderConfig.rounding >= root.height startX: 0 startY: wrapper.y diff --git a/modules/drawers/Panels.qml b/modules/drawers/Panels.qml index 844a719..0fb76d5 100644 --- a/modules/drawers/Panels.qml +++ b/modules/drawers/Panels.qml @@ -80,6 +80,12 @@ Item { anchors.left: parent.left anchors.verticalCenter: parent.top - anchors.verticalCenterOffset: Popouts.currentCenter - BorderConfig.thickness + anchors.verticalCenterOffset: { + const off = Popouts.currentCenter - BorderConfig.thickness; + const diff = root.height - Math.floor(off + implicitHeight / 2 - BorderConfig.rounding); + if (diff < 0) + return off + diff; + return off; + } } } |