From 1ee78be8453f86ef366fe7a73e4e8cf245d2d336 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 11 Jul 2026 04:31:59 -0400 Subject: Added qs-hyprview as alternative overview Signed-off-by: Don Williams On branch development Your branch is up to date with 'origin/development'. Changes to be committed: deleted: ./ new file: LICENSE new file: README.md new file: common/Appearance.qml new file: layouts/BandsLayout.qml new file: layouts/ColumnarLayout.qml new file: layouts/HeroLayout.qml new file: layouts/JustifiedLayout.qml new file: layouts/LayoutsManager.qml new file: layouts/MasonryLayout.qml new file: layouts/SatelliteLayout.qml new file: layouts/SmartGridLayout.qml new file: layouts/SpiralLayout.qml new file: layouts/StarggeredLayout.qml new file: layouts/VortexLayout.qml new file: layouts/qmldir new file: modules/Hyprview.qml new file: modules/SearchBox.qml new file: modules/WindowThumbnail.qml new file: modules/qmldir new file: qs-hyprview-template.qml new file: screenshots/bands.jpeg new file: screenshots/hero.jpeg new file: screenshots/masonry.jpeg new file: screenshots/satellite.jpeg new file: screenshots/smartgrid.jpeg new file: screenshots/spiral.jpeg new file: screenshots/staggered.jpeg new file: screenshots/vortex.jpeg new file: shell.qml --- .../qs-hyprview/layouts/ColumnarLayout.qml | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 config/quickshell/qs-hyprview/layouts/ColumnarLayout.qml (limited to 'config/quickshell/qs-hyprview/layouts/ColumnarLayout.qml') diff --git a/config/quickshell/qs-hyprview/layouts/ColumnarLayout.qml b/config/quickshell/qs-hyprview/layouts/ColumnarLayout.qml new file mode 100644 index 00000000..feaa9afa --- /dev/null +++ b/config/quickshell/qs-hyprview/layouts/ColumnarLayout.qml @@ -0,0 +1,72 @@ +pragma Singleton +import Quickshell + +Singleton { + id: root + + function doLayout(windowList, outerWidth, outerHeight) { + var N = windowList.length + if (N === 0) return [] + + var gap = Math.max(8, outerWidth * 0.005) + + // Safe Area: We use slightly more width here (95%) + // as vertical strips look better when filling the screen horizontally. + var useW = outerWidth * 0.95 + var useH = outerHeight * 0.90 + var offX = (outerWidth - useW) / 2 + var offY = (outerHeight - useH) / 2 + + // Calculate width of a single column + var colW = (useW - (gap * (N - 1))) / N + + // Safety: If columns become too narrow (e.g. < 200px), + // we clamp the width to keep them readable. + var minColW = 200 + if (colW < minColW) colW = minColW + + // Calculate the actual total width used + var totalW = N * colW + (N - 1) * gap + + // Center the group horizontally. + // If N is small, it centers. If N is large (clamped), it starts from left. + var startX = offX + if (totalW < useW) { + startX = offX + (useW - totalW) / 2 + } + + var result = [] + + for (var i = 0; i < N; i++) { + var item = windowList[i] + + var w0 = (item.width > 0) ? item.width : 100 + var h0 = (item.height > 0) ? item.height : 100 + + // In this layout, vertical space is abundant (useH). + // The constraining factor is usually the column width. + var sc = Math.min(colW / w0, useH / h0) + + var thumbW = w0 * sc + var thumbH = h0 * sc + + var xPos = startX + i * (colW + gap) + + // Center horizontally within the strip + var xCentered = xPos + (colW - thumbW) / 2 + + // Center vertically on screen + var yCentered = offY + (useH - thumbH) / 2 + + result.push({ + win: item.win, + x: xCentered, + y: yCentered, + width: thumbW, + height: thumbH + }) + } + + return result + } +} -- cgit v1.2.3