diff --git a/dots/.config/quickshell/ii/modules/common/Config.qml b/dots/.config/quickshell/ii/modules/common/Config.qml index f9a9a8654..4fed1b6fb 100644 --- a/dots/.config/quickshell/ii/modules/common/Config.qml +++ b/dots/.config/quickshell/ii/modules/common/Config.qml @@ -418,6 +418,8 @@ Singleton { property real scale: 0.18 // Relative to screen size property real rows: 2 property real columns: 5 + property bool orderRightLeft: false + property bool orderBottomUp: false property bool centerIcons: true } diff --git a/dots/.config/quickshell/ii/modules/ii/overview/OverviewWidget.qml b/dots/.config/quickshell/ii/modules/ii/overview/OverviewWidget.qml index db424e0e6..f6891fb31 100644 --- a/dots/.config/quickshell/ii/modules/ii/overview/OverviewWidget.qml +++ b/dots/.config/quickshell/ii/modules/ii/overview/OverviewWidget.qml @@ -50,6 +50,24 @@ Item { property Component windowComponent: OverviewWindow {} property list windowWidgets: [] + + function getWsRow(ws) + { + // 1-indexed workspace, 0-indexed row + var normalRow = Math.floor((ws - 1) / Config.options.overview.columns) % Config.options.overview.rows; + return (Config.options.overview.orderBottomUp ? Config.options.overview.rows - normalRow - 1 : normalRow); + } + function getWsColumn(ws) + { + // 1-indexed workspace, 0-indexed column + var normalCol = (ws - 1) % Config.options.overview.columns; + return (Config.options.overview.orderRightLeft ? Config.options.overview.columns - normalCol - 1 : normalCol); + } + function getWsInCell(ri, ci) + { + // 1-indexed workspace, 0-indexed row and column index + return (Config.options.overview.orderBottomUp ? Config.options.overview.rows - ri - 1 : ri) * Config.options.overview.columns + (Config.options.overview.orderRightLeft ? Config.options.overview.columns - ci - 1 : ci) + 1 + } StyledRectangularShadow { target: overviewBackground @@ -85,7 +103,7 @@ Item { id: workspace required property int index property int colIndex: index - property int workspaceValue: root.workspaceGroup * root.workspacesShown + row.index * Config.options.overview.columns + colIndex + 1 + property int workspaceValue: root.workspaceGroup * root.workspacesShown + getWsInCell(row.index, colIndex) property color defaultWorkspaceColor: ColorUtils.mix(Appearance.colors.colBackgroundSurfaceContainer, Appearance.colors.colSurfaceContainerHigh, 0.8) property color hoveredWorkspaceColor: ColorUtils.mix(defaultWorkspaceColor, Appearance.colors.colLayer1Hover, 0.1) property color hoveredBorderColor: Appearance.colors.colLayer2Hover @@ -182,8 +200,8 @@ Item { property bool atInitPosition: (initX == x && initY == y) // Offset on the canvas - property int workspaceColIndex: (windowData?.workspace.id - 1) % Config.options.overview.columns - property int workspaceRowIndex: Math.floor((windowData?.workspace.id - 1) % root.workspacesShown / Config.options.overview.columns) + property int workspaceColIndex: getWsColumn(windowData?.workspace.id) + property int workspaceRowIndex: getWsRow(windowData?.workspace.id) xOffset: (root.workspaceImplicitWidth + workspaceSpacing) * workspaceColIndex yOffset: (root.workspaceImplicitHeight + workspaceSpacing) * workspaceRowIndex property real xWithinWorkspaceWidget: Math.max((windowData?.at[0] - (monitor?.x ?? 0) - monitorData?.reserved[0]) * root.scale, 0) @@ -286,9 +304,8 @@ Item { Rectangle { // Focused workspace indicator id: focusedWorkspaceIndicator - property int activeWorkspaceInGroup: monitor.activeWorkspace?.id - (root.workspaceGroup * root.workspacesShown) - property int rowIndex: Math.floor((activeWorkspaceInGroup - 1) / Config.options.overview.columns) - property int colIndex: (activeWorkspaceInGroup - 1) % Config.options.overview.columns + property int rowIndex: getWsRow(monitor.activeWorkspace?.id) + property int colIndex: getWsColumn(monitor.activeWorkspace?.id) x: (root.workspaceImplicitWidth + workspaceSpacing) * colIndex y: (root.workspaceImplicitHeight + workspaceSpacing) * rowIndex z: root.windowZ diff --git a/dots/.config/quickshell/ii/modules/settings/InterfaceConfig.qml b/dots/.config/quickshell/ii/modules/settings/InterfaceConfig.qml index b99e291b0..f94f1e811 100644 --- a/dots/.config/quickshell/ii/modules/settings/InterfaceConfig.qml +++ b/dots/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -739,6 +739,45 @@ ContentPage { } } } + ConfigRow { + uniform: true + ConfigSelectionArray { + currentValue: Config.options.overview.orderRightLeft + onSelected: newValue => { + Config.options.overview.orderRightLeft = newValue + } + options: [ + { + displayName: Translation.tr("Left to right"), + icon: "arrow_forward", + value: 0 + }, + { + displayName: Translation.tr("Right to left"), + icon: "arrow_back", + value: 1 + } + ] + } + ConfigSelectionArray { + currentValue: Config.options.overview.orderBottomUp + onSelected: newValue => { + Config.options.overview.orderBottomUp = newValue + } + options: [ + { + displayName: Translation.tr("Top-down"), + icon: "arrow_downward", + value: 0 + }, + { + displayName: Translation.tr("Bottom-up"), + icon: "arrow_upward", + value: 1 + } + ] + } + } } ContentSection {