diff options
| author | Don Williams <Don.e.williams@gmail.com> | 2026-07-04 17:28:36 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:39:35 -0700 |
| commit | e974676da74ca270b289f789ae055e3a9b4012fe (patch) | |
| tree | e43881adb8d2ab15b85d009e7ad85999d6f61416 /config/quickshell/overview-bak/modules/overview/Overview.qml | |
| parent | 2f4b617fbb4214e50ae0bc44fd4acb5385731c75 (diff) | |
Updated quickshell overview to current version
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:
modified: CHANGELOG.md
new file: config/quickshell/overview-bak/README.md
new file: config/quickshell/overview-bak/assets/image.png
new file: config/quickshell/overview-bak/common/Appearance.qml
new file: config/quickshell/overview-bak/common/Config.qml
new file: config/quickshell/overview-bak/common/functions/ColorUtils.qml
new file: config/quickshell/overview-bak/common/functions/qmldir
new file: config/quickshell/overview-bak/common/qmldir
new file: config/quickshell/overview-bak/common/widgets/StyledRectangularShadow.qml
new file: config/quickshell/overview-bak/common/widgets/StyledText.qml
new file: config/quickshell/overview-bak/common/widgets/StyledToolTip.qml
new file: config/quickshell/overview-bak/common/widgets/StyledToolTipContent.qml
new file: config/quickshell/overview-bak/common/widgets/qmldir
new file: config/quickshell/overview-bak/modules/overview/Overview.qml
new file: config/quickshell/overview-bak/modules/overview/OverviewWidget.qml
new file: config/quickshell/overview-bak/modules/overview/OverviewWindow.qml
new file: config/quickshell/overview-bak/modules/overview/qmldir
new file: config/quickshell/overview-bak/services/GlobalStates.qml
new file: config/quickshell/overview-bak/services/HyprlandData.qml
new file: config/quickshell/overview-bak/services/qmldir
new file: config/quickshell/overview-bak/shell.qml
new file: config/quickshell/overview/.github/FUNDING.yml
modified: config/quickshell/overview/README.md
new file: config/quickshell/overview/assets/Workspace_Wallpaper.png
modified: config/quickshell/overview/assets/image.png
modified: config/quickshell/overview/common/Appearance.qml
modified: config/quickshell/overview/common/Config.qml
new file: config/quickshell/overview/config.example.json
modified: config/quickshell/overview/modules/overview/Overview.qml
modified: config/quickshell/overview/modules/overview/OverviewWidget.qml
modified: config/quickshell/overview/modules/overview/OverviewWindow.qml
new file: config/quickshell/overview/quickshell-overview.qml
modified: config/quickshell/overview/services/HyprlandData.qml
modified: config/quickshell/overview/shell.qml
Diffstat (limited to 'config/quickshell/overview-bak/modules/overview/Overview.qml')
| -rw-r--r-- | config/quickshell/overview-bak/modules/overview/Overview.qml | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/config/quickshell/overview-bak/modules/overview/Overview.qml b/config/quickshell/overview-bak/modules/overview/Overview.qml new file mode 100644 index 00000000..b3a299cb --- /dev/null +++ b/config/quickshell/overview-bak/modules/overview/Overview.qml @@ -0,0 +1,147 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Io +import Quickshell.Wayland +import Quickshell.Hyprland +import "../../common" +import "../../services" +import "." + +Scope { + id: overviewScope + Variants { + id: overviewVariants + model: Quickshell.screens + PanelWindow { + id: root + required property var modelData + readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen) + property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor?.id) + screen: modelData + visible: GlobalStates.overviewOpen + + WlrLayershell.namespace: "quickshell:overview" + WlrLayershell.layer: WlrLayer.Overlay + WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive + color: "transparent" + + mask: Region { + item: GlobalStates.overviewOpen ? keyHandler : null + } + + anchors { + top: true + bottom: true + left: !(Config?.options.overview.enable ?? true) + right: !(Config?.options.overview.enable ?? true) + } + + HyprlandFocusGrab { + id: grab + windows: [root] + property bool canBeActive: root.monitorIsFocused + active: false + onCleared: () => { + if (!active) + GlobalStates.overviewOpen = false; + } + } + + Connections { + target: GlobalStates + function onOverviewOpenChanged() { + if (GlobalStates.overviewOpen) { + delayedGrabTimer.start(); + } + } + } + + Timer { + id: delayedGrabTimer + interval: Config.options.hacks.arbitraryRaceConditionDelay + repeat: false + onTriggered: { + if (!grab.canBeActive) + return; + grab.active = GlobalStates.overviewOpen; + } + } + + implicitWidth: columnLayout.implicitWidth + implicitHeight: columnLayout.implicitHeight + + Item { + id: keyHandler + anchors.fill: parent + visible: GlobalStates.overviewOpen + focus: GlobalStates.overviewOpen + + Keys.onPressed: event => { + if (event.key === Qt.Key_Escape || event.key === Qt.Key_Return) { + GlobalStates.overviewOpen = false; + event.accepted = true; + } else if (event.key === Qt.Key_Left || event.key === Qt.Key_Right || event.key === Qt.Key_Up || event.key === Qt.Key_Down) { + const workspacesPerGroup = Config.options.overview.rows * Config.options.overview.columns; + const currentId = Hyprland.focusedMonitor?.activeWorkspace?.id ?? 1; + const currentGroup = Math.floor((currentId - 1) / workspacesPerGroup); + const minWorkspaceId = currentGroup * workspacesPerGroup + 1; + const maxWorkspaceId = minWorkspaceId + workspacesPerGroup - 1; + + let targetId; + if (event.key === Qt.Key_Left) { + targetId = currentId - 1; + if (targetId < minWorkspaceId) targetId = maxWorkspaceId; + } else if (event.key === Qt.Key_Right) { + targetId = currentId + 1; + if (targetId > maxWorkspaceId) targetId = minWorkspaceId; + } else if (event.key === Qt.Key_Up) { + targetId = currentId - Config.options.overview.columns; + if (targetId < minWorkspaceId) targetId += workspacesPerGroup; + } else { + targetId = currentId + Config.options.overview.columns; + if (targetId > maxWorkspaceId) targetId -= workspacesPerGroup; + } + + Hyprland.dispatch("workspace " + targetId); + event.accepted = true; + } + } + } + + ColumnLayout { + id: columnLayout + visible: GlobalStates.overviewOpen + anchors { + horizontalCenter: parent.horizontalCenter + top: parent.top + topMargin: 100 + } + + Loader { + id: overviewLoader + active: GlobalStates.overviewOpen && (Config?.options.overview.enable ?? true) + sourceComponent: OverviewWidget { + panelWindow: root + visible: true + } + } + } + } + } + + IpcHandler { + target: "overview" + + function toggle() { + GlobalStates.overviewOpen = !GlobalStates.overviewOpen; + } + function close() { + GlobalStates.overviewOpen = false; + } + function open() { + GlobalStates.overviewOpen = true; + } + } +} |
