diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-07-13 15:58:40 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:40:34 -0700 |
| commit | 292b6daf5c56ff60a6263ff4945e74e5ca4372e7 (patch) | |
| tree | 0c01784cf05adc8deec5a8a50fa71e1db294c96e /config/quickshell/qs-hyprview-trixie/modules/WindowThumbnail.qml | |
| parent | 54b56290253719aa71d8ccfddff6fa0424e22804 (diff) | |
Creating an overview version that works with all branches
Signed-off-by: Don Williams <don.e.williams@gmail.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
new file: config/quickshell/overview-unified/README.md
new file: config/quickshell/overview-unified/assets/image.png
new file: config/quickshell/overview-unified/common/Appearance.qml
new file: config/quickshell/overview-unified/common/Config.qml
new file: config/quickshell/overview-unified/common/functions/ColorUtils.qml
new file: config/quickshell/overview-unified/common/functions/qmldir
new file: config/quickshell/overview-unified/common/qmldir
new file: config/quickshell/overview-unified/common/widgets/RectangularShadow.qml
new file: config/quickshell/overview-unified/common/widgets/StyledRectangularShadow.qml
new file: config/quickshell/overview-unified/common/widgets/StyledText.qml
new file: config/quickshell/overview-unified/common/widgets/StyledToolTip.qml
new file: config/quickshell/overview-unified/common/widgets/StyledToolTipContent.qml
new file: config/quickshell/overview-unified/common/widgets/qmldir
new file: config/quickshell/overview-unified/modules/overview/Overview.qml
new file: config/quickshell/overview-unified/modules/overview/OverviewWidget.qml
new file: config/quickshell/overview-unified/modules/overview/OverviewWindow.qml
new file: config/quickshell/overview-unified/modules/overview/qmldir
new file: config/quickshell/overview-unified/services/GlobalStates.qml
new file: config/quickshell/overview-unified/services/HyprlandData.qml
new file: config/quickshell/overview-unified/services/qmldir
new file: config/quickshell/overview-unified/shell.qml
new file: config/quickshell/qs-hyprview-trixie/LICENSE
new file: config/quickshell/qs-hyprview-trixie/README.md
new file: config/quickshell/qs-hyprview-trixie/common/Appearance.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/BandsLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/ColumnarLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/HeroLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/JustifiedLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/LayoutsManager.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/MasonryLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/SatelliteLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/SmartGridLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/SpiralLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/StarggeredLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/VortexLayout.qml
new file: config/quickshell/qs-hyprview-trixie/layouts/qmldir
new file: config/quickshell/qs-hyprview-trixie/modules/Hyprview.qml
new file: config/quickshell/qs-hyprview-trixie/modules/SearchBox.qml
new file: config/quickshell/qs-hyprview-trixie/modules/WindowThumbnail.qml
new file: config/quickshell/qs-hyprview-trixie/modules/qmldir
new file: config/quickshell/qs-hyprview-trixie/qs-hyprview-template.qml
new file: config/quickshell/qs-hyprview-trixie/screenshots/bands.jpeg
new file: config/quickshell/qs-hyprview-trixie/screenshots/hero.jpeg
new file: config/quickshell/qs-hyprview-trixie/screenshots/masonry.jpeg
new file: config/quickshell/qs-hyprview-trixie/screenshots/satellite.jpeg
new file: config/quickshell/qs-hyprview-trixie/screenshots/smartgrid.jpeg
new file: config/quickshell/qs-hyprview-trixie/screenshots/spiral.jpeg
new file: config/quickshell/qs-hyprview-trixie/screenshots/staggered.jpeg
new file: config/quickshell/qs-hyprview-trixie/screenshots/vortex.jpeg
new file: config/quickshell/qs-hyprview-trixie/shell.qml
Diffstat (limited to 'config/quickshell/qs-hyprview-trixie/modules/WindowThumbnail.qml')
| -rw-r--r-- | config/quickshell/qs-hyprview-trixie/modules/WindowThumbnail.qml | 278 |
1 files changed, 278 insertions, 0 deletions
diff --git a/config/quickshell/qs-hyprview-trixie/modules/WindowThumbnail.qml b/config/quickshell/qs-hyprview-trixie/modules/WindowThumbnail.qml new file mode 100644 index 00000000..89383291 --- /dev/null +++ b/config/quickshell/qs-hyprview-trixie/modules/WindowThumbnail.qml @@ -0,0 +1,278 @@ +import QtQuick +import QtQuick.Effects +import Quickshell +import Quickshell.Io +import Quickshell.Widgets +import Quickshell.Wayland +import Quickshell.Hyprland +import Qt5Compat.GraphicalEffects + +Item { + id: thumbContainer + + property var hWin: null + property var wHandle:null + + property string winKey: '' + + property real thumbW: -1 + property real thumbH: -1 + + property var clientInfo: {} + property bool hovered: false + + property real targetX: -1000 + property real targetY: -1000 + property real targetZ: 0 + property real targetRotation: 0 + + property bool moveCursorToActiveWindow: false + + width: thumbW + height: thumbH + + x: 0 + y: 0 + z: targetZ + rotation: 0 + + visible: !!wHandle + + NumberAnimation { + id: animX + target: thumbContainer + property: "x" + duration: root.animateWindows ? 100 : 0 + easing.type: Easing.OutQuad + } + NumberAnimation { + id: animY + target: thumbContainer + property: "y" + duration: root.animateWindows ? 100 : 0 + easing.type: Easing.OutQuad + } + NumberAnimation { + id: animRotation + target: thumbContainer + property: "rotation" + duration: 400 + easing.type: Easing.OutBack // Effetto rimbalzo/inerzia + easing.overshoot: 1.2 + } + + function updateLastPos() { + var lp = root.lastPositions || ({}) + var prev = lp[winKey] || ({}) + prev.x = x + prev.y = y + lp[winKey] = prev + root.lastPositions = lp + } + + onTargetXChanged: { + if (!root.animateWindows) { + x = targetX + updateLastPos() + return + } + + var lp = root.lastPositions || ({}) + var prev = lp[winKey] + var startX = (prev && prev.x !== undefined) ? prev.x : targetX + + if (startX === targetX) { + x = targetX + updateLastPos() + return + } + + animX.stop() + animX.from = startX + animX.to = targetX + animX.start() + } + + onTargetYChanged: { + if (!root.animateWindows) { + y = targetY + updateLastPos() + return + } + + var lp = root.lastPositions || ({}) + var prev = lp[winKey] + var startY = (prev && prev.y !== undefined) ? prev.y : targetY + + if (startY === targetY) { + y = targetY + updateLastPos() + return + } + + animY.stop() + animY.from = startY + animY.to = targetY + animY.start() + } + + onTargetRotationChanged: { + rotation = targetRotation + animRotation.stop() + animRotation.from = 0 + animRotation.to = targetRotation + animRotation.start() + } + + onXChanged: updateLastPos() + onYChanged: updateLastPos() + + Component.onCompleted: { + rotation = targetRotation + if (!root.animateWindows) { + x = targetX + y = targetY + updateLastPos() + } + } + + function activateWindow() { + if (!hWin) return + + var targetIsSpecial = (hWin?.workspace ?? 0) < 0 || (hWin?.workspace?.name ?? "").startsWith("special") + + if (root.specialActive && !targetIsSpecial) { + Hyprland.dispatch("togglespecialworkspace") + } + + if (hWin.workspace) { + hWin.workspace.activate() + } + + root.toggleExpose() + Hyprland.dispatch("focuswindow address:0x" + hWin.address) + Hyprland.dispatch("alterzorder top") + if (thumbContainer.moveCursorToActiveWindow) { + var cx = clientInfo.at[0] + (clientInfo.size[0]/2) + var cy = clientInfo.at[1] + (clientInfo.size[1]/2) + Hyprland.dispatch("movecursor " + cx + " " + cy) + + } + } + + function closeWindow() { + if (!hWin) return + Hyprland.dispatch("closewindow address:0x" + hWin.address) + } + + function refreshThumb() { + if (thumbLoader.item) { + thumbLoader.item.captureFrame() + } + } + + Item { + id: card + anchors.fill: parent + + scale: thumbContainer.hovered ? 1.05 : 0.95 + transformOrigin: Item.Center + + Behavior on scale { + NumberAnimation { duration: 100; easing.type: Easing.OutQuad } + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.LeftButton | Qt.MiddleButton + + onEntered: { + exposeArea.currentIndex = index + } + onClicked: event => { + exposeArea.currentIndex = index + + if (event.button === Qt.LeftButton) { + thumbContainer.activateWindow() + } + if (event.button === Qt.MiddleButton) { + thumbContainer.closeWindow() + } + } + onExited: { + if (exposeArea.currentIndex === index) { + exposeArea.currentIndex = -1 + } + } + } + + RectangularShadow { + anchors.fill: parent + radius: 16 + blur: 24 + spread: 10 + color: "#55000000" + cached: true + } + + Loader { + id: thumbLoader + anchors.fill: parent + active: root.isActive && !!thumbContainer.wHandle + sourceComponent: ScreencopyView { + id: thumb + anchors.fill: parent + captureSource: thumbContainer.wHandle + live: root.liveCapture && root.isActive + paintCursor: false + visible: root.isActive && thumbContainer.wHandle && hasContent + + layer.enabled: true + layer.effect: OpacityMask { + maskSource: Rectangle { + width: thumb.width + height: thumb.height + radius: 16 + } + } + + Rectangle { + anchors.fill: parent + color: thumbContainer.hovered ? "transparent": "#33000000" + border.width : thumbContainer.hovered ? 3 : 1 + border.color : thumbContainer.hovered ? m3.m3Primary : m3.m3Secondary + radius: 16 + } + } + } + + Rectangle { + id: badge + z: 100 + width: Math.min(titleText.implicitWidth + 24, thumbContainer.thumbW * 0.75) + height: titleText.implicitHeight + 12 + + x: (card.width - width) / 2 + y: card.height - height - (card.height * 0.08) + + radius: 12 + color: thumbContainer.hovered ? "#FF000000" : "#CC000000" + border.width : 1 + border.color : "#ff464646" + + Text { + id: titleText + anchors.centerIn: parent + width: parent.width - 16 + text: hWin.title + color: "white" + font.pixelSize: thumbContainer.hovered ? 13 : 12 + elide: Text.ElideRight + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } + } +} |
