From eb33b533c6c4c330416d492f0c3202fc1b67a4a5 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Fri, 10 Apr 2026 13:32:16 +0200 Subject: [PATCH] Show window count indicator dots on dock icons When multiple windows of the same application are open, each dock icon displays a row of dots matching the sibling window count. The active window's dots are bright; inactive siblings are dimmed. Single-window apps show one dot as before. Uses the TasksModel AppId role to count windows sharing the same application identity. --- .../homescreens/folio/qml/FavouritesBar.qml | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/containments/homescreens/folio/qml/FavouritesBar.qml b/containments/homescreens/folio/qml/FavouritesBar.qml index c8ca2806..1b3a8a7a 100644 --- a/containments/homescreens/folio/qml/FavouritesBar.qml +++ b/containments/homescreens/folio/qml/FavouritesBar.qml @@ -131,6 +131,18 @@ MouseArea { groupMode: TaskManager.TasksModel.GroupDisabled } + // Count how many windows share the same AppId as the task at the given index + function windowCountForTask(taskIndex) { + var appId = tasksModel.data(tasksModel.makeModelIndex(taskIndex), TaskManager.AbstractTasksModel.AppId) + if (!appId) return 1 + var count = 0 + for (var i = 0; i < tasksModel.rowCount(); i++) { + if (tasksModel.data(tasksModel.makeModelIndex(i), TaskManager.AbstractTasksModel.AppId) === appId) + count++ + } + return count + } + acceptedButtons: Qt.LeftButton | Qt.RightButton onPressAndHold: { @@ -619,16 +631,24 @@ MouseArea { active: taskMouseArea.containsMouse } - // Active-window indicator dot - Rectangle { + // Window indicator dots (one per sibling window of the same app) + Row { anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter anchors.bottomMargin: Kirigami.Units.smallSpacing / 2 - width: Kirigami.Units.smallSpacing * 2 - height: width - radius: width / 2 - color: Kirigami.Theme.highlightColor - visible: taskDelegate.model.IsActive === true + spacing: Kirigami.Units.smallSpacing / 2 + + Repeater { + model: root.windowCountForTask(taskDelegate.index) + + Rectangle { + width: Kirigami.Units.smallSpacing * 1.5 + height: width + radius: width / 2 + color: Kirigami.Theme.highlightColor + opacity: taskDelegate.model.IsActive === true ? 1.0 : 0.4 + } + } } // Click to activate, hover for thumbnail preview