diff --git a/README.md b/README.md index afa89f1..cbd7910 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ https://github.com/user-attachments/assets/79ceb141-6b9e-4956-8e09-aaf72b66550c ## ✨ Features - 🖼️ Visual workspace overview showing all workspaces and windows +- 🖥️ Multi-monitor support with proper scaling and vertical/rotated monitors [in experimental branch] +- 📐 Smart row hiding - optionally hide empty workspace rows - 🎯 Click windows to focus them - 🖱️ Middle-click windows to close them - 🔄 Drag and drop windows between workspaces @@ -122,6 +124,7 @@ property QtObject overview: QtObject { property int columns: 5 // Number of workspace columns (10 total workspaces) property real scale: 0.16 // Overview scale factor (0.1-0.3, smaller = more compact) property bool enable: true + property bool hideEmptyRows: true // Hide workspace rows with no windows (recommended!) } ``` @@ -130,6 +133,12 @@ property QtObject overview: QtObject { - **Too big?** Decrease `scale` (try 0.12 or 0.14) - **More workspaces?** Change `rows` and `columns` (e.g., 3 rows × 4 columns = 12 workspaces) +**Hide empty workspace rows:** +- Set `hideEmptyRows: true` to automatically hide rows that have no windows +- Keeps your overview clean by only showing rows with active workspaces +- The current workspace row is always visible, even if empty +- Great for 2-row setups where you rarely use workspaces 6-10 + ### Position Edit `~/.config/quickshell/overview/modules/overview/Overview.qml` (line ~111): diff --git a/common/Config.qml b/common/Config.qml index 2e01668..d1caa93 100644 --- a/common/Config.qml +++ b/common/Config.qml @@ -17,6 +17,7 @@ Singleton { property int columns: 5 property real scale: 0.16 property bool enable: true + property bool hideEmptyRows: true // Hide workspace rows with no windows } property QtObject hacks: QtObject { diff --git a/modules/overview/OverviewWidget.qml b/modules/overview/OverviewWidget.qml index 7defa64..64d2876 100644 --- a/modules/overview/OverviewWidget.qml +++ b/modules/overview/OverviewWidget.qml @@ -41,6 +41,33 @@ Item { property int draggingFromWorkspace: -1 property int draggingTargetWorkspace: -1 + // Calculate which rows have windows or current workspace + property var rowsWithContent: { + if (!Config.options.overview.hideEmptyRows) return null; + + let rows = new Set(); + const firstWorkspace = root.workspaceGroup * root.workspacesShown + 1; + const lastWorkspace = (root.workspaceGroup + 1) * root.workspacesShown; + + // Add row containing current workspace + const currentWorkspace = monitor.activeWorkspace?.id ?? 1; + if (currentWorkspace >= firstWorkspace && currentWorkspace <= lastWorkspace) { + rows.add(Math.floor((currentWorkspace - firstWorkspace) / Config.options.overview.columns)); + } + + // Add rows with windows + for (let addr in windowByAddress) { + const win = windowByAddress[addr]; + const wsId = win?.workspace?.id; + if (wsId >= firstWorkspace && wsId <= lastWorkspace) { + const rowIndex = Math.floor((wsId - firstWorkspace) / Config.options.overview.columns); + rows.add(rowIndex); + } + } + + return rows; + } + implicitWidth: overviewBackground.implicitWidth + Appearance.sizes.elevationMargin * 2 implicitHeight: overviewBackground.implicitHeight + Appearance.sizes.elevationMargin * 2 @@ -75,6 +102,9 @@ Item { id: row property int rowIndex: index spacing: workspaceSpacing + visible: !Config.options.overview.hideEmptyRows || + (root.rowsWithContent && root.rowsWithContent.has(rowIndex)) + height: visible ? implicitHeight : 0 Repeater { // Workspace repeater model: Config.options.overview.columns