diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-19 22:15:44 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-19 22:15:44 +1000 |
| commit | 75b618f1e89cbcaf1a674c016f3b801ac04e62d0 (patch) | |
| tree | 4bb6cf4b49461e6b5bc837f82deacf6d9ae089cc /modules | |
| parent | launcher: better empty text (diff) | |
| download | caelestia-shell-75b618f1e89cbcaf1a674c016f3b801ac04e62d0.tar.gz caelestia-shell-75b618f1e89cbcaf1a674c016f3b801ac04e62d0.tar.bz2 caelestia-shell-75b618f1e89cbcaf1a674c016f3b801ac04e62d0.zip | |
picker: better manual selection
No rounding and thinner border when selecting manually
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/areapicker/Picker.qml | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/modules/areapicker/Picker.qml b/modules/areapicker/Picker.qml index 2571259..256085d 100644 --- a/modules/areapicker/Picker.qml +++ b/modules/areapicker/Picker.qml @@ -16,7 +16,12 @@ MouseArea { required property ShellScreen screen property int borderWidth - property real rounding + property int rounding + + property bool onClient + + property real realBorderWidth: onClient ? borderWidth : 2 + property real realRounding: onClient ? rounding : 0 property real ssx property real ssy @@ -36,6 +41,7 @@ MouseArea { function checkClientRects(x: real, y: real): void { for (const c of clients) { if (c.x <= x && c.y <= y && c.x + c.width >= x && c.y + c.height >= y) { + onClient = true; sx = c.x; sy = c.y; ex = c.x + c.width; @@ -80,6 +86,7 @@ MouseArea { const y = event.y; if (pressed) { + onClient = false; sx = ssx; sy = ssy; ex = x; @@ -183,7 +190,7 @@ MouseArea { Rectangle { id: selectionRect - radius: root.rounding + radius: root.realRounding x: root.rsx y: root.rsy implicitWidth: root.sw @@ -204,14 +211,14 @@ MouseArea { Rectangle { color: "transparent" - radius: root.rounding > 0 ? root.rounding + root.borderWidth : 0 - border.width: root.borderWidth + radius: root.realRounding > 0 ? root.realRounding + root.realBorderWidth : 0 + border.width: root.realBorderWidth border.color: Colours.palette.m3primary - x: selectionRect.x - root.borderWidth - y: selectionRect.y - root.borderWidth - implicitWidth: selectionRect.implicitWidth + root.borderWidth * 2 - implicitHeight: selectionRect.implicitHeight + root.borderWidth * 2 + x: selectionRect.x - root.realBorderWidth + y: selectionRect.y - root.realBorderWidth + implicitWidth: selectionRect.implicitWidth + root.realBorderWidth * 2 + implicitHeight: selectionRect.implicitHeight + root.realBorderWidth * 2 Behavior on border.color { ColorAnimation { |