Commit 7ae51e54 authored by Fushan Wen's avatar Fushan Wen 💬 Committed by Nate Graham
Browse files

applets/taskmanager: Update tooltip bindings when activating from keyboard

When activating a task from keyboard, there is no containsMouse changed
signal, so we need to update the tooltip properties here.

BUG: 452187
FIXED-IN: 5.24.5


(cherry picked from commit 130f32ee)
parent 59359747
Pipeline #162813 passed with stage
in 3 minutes and 36 seconds
......@@ -344,33 +344,36 @@ MouseArea {
}
}
onContainsMouseChanged: {
if (containsMouse) {
if (tasks.toolTipOpenedByClick !== null && tasks.toolTipOpenedByClick !== task) {
return;
}
onContainsMouseChanged: if (containsMouse) {
updateMainItemBindings();
}
mainItem.parentTask = task;
mainItem.rootIndex = tasksModel.makeModelIndex(itemIndex, -1);
mainItem.appName = Qt.binding(() => model.AppName);
mainItem.pidParent = Qt.binding(() => model.AppPid !== undefined ? model.AppPid : 0);
mainItem.windows = Qt.binding(() => model.WinIdList);
mainItem.isGroup = Qt.binding(() => model.IsGroupParent === true);
mainItem.icon = Qt.binding(() => model.decoration);
mainItem.launcherUrl = Qt.binding(() => model.LauncherUrlWithoutIcon);
mainItem.isLauncher = Qt.binding(() => model.IsLauncher === true);
mainItem.isMinimizedParent = Qt.binding(() => model.IsMinimized === true);
mainItem.displayParent = Qt.binding(() => model.display);
mainItem.genericName = Qt.binding(() => model.GenericName);
mainItem.virtualDesktopParent = Qt.binding(() =>
(model.VirtualDesktops !== undefined && model.VirtualDesktops.length > 0) ? model.VirtualDesktops : [0]);
mainItem.isOnAllVirtualDesktopsParent = Qt.binding(() => model.IsOnAllVirtualDesktops === true);
mainItem.activitiesParent = Qt.binding(() => model.Activities);
mainItem.smartLauncherCountVisible = Qt.binding(() => task.smartLauncherItem && task.smartLauncherItem.countVisible);
mainItem.smartLauncherCount = Qt.binding(() => mainItem.smartLauncherCountVisible ? task.smartLauncherItem.count : 0);
// Will also be called in activateTaskAtIndex(index)
function updateMainItemBindings() {
if (tasks.toolTipOpenedByClick !== null && tasks.toolTipOpenedByClick !== task) {
return;
}
mainItem.parentTask = task;
mainItem.rootIndex = tasksModel.makeModelIndex(itemIndex, -1);
mainItem.appName = Qt.binding(() => model.AppName);
mainItem.pidParent = Qt.binding(() => model.AppPid !== undefined ? model.AppPid : 0);
mainItem.windows = Qt.binding(() => model.WinIdList);
mainItem.isGroup = Qt.binding(() => model.IsGroupParent === true);
mainItem.icon = Qt.binding(() => model.decoration);
mainItem.launcherUrl = Qt.binding(() => model.LauncherUrlWithoutIcon);
mainItem.isLauncher = Qt.binding(() => model.IsLauncher === true);
mainItem.isMinimizedParent = Qt.binding(() => model.IsMinimized === true);
mainItem.displayParent = Qt.binding(() => model.display);
mainItem.genericName = Qt.binding(() => model.GenericName);
mainItem.virtualDesktopParent = Qt.binding(() =>
(model.VirtualDesktops !== undefined && model.VirtualDesktops.length > 0) ? model.VirtualDesktops : [0]);
mainItem.isOnAllVirtualDesktopsParent = Qt.binding(() => model.IsOnAllVirtualDesktops === true);
mainItem.activitiesParent = Qt.binding(() => model.Activities);
mainItem.smartLauncherCountVisible = Qt.binding(() => task.smartLauncherItem && task.smartLauncherItem.countVisible);
mainItem.smartLauncherCount = Qt.binding(() => mainItem.smartLauncherCountVisible ? task.smartLauncherItem.count : 0);
}
}
}
......
......@@ -501,6 +501,16 @@ MouseArea {
var task = taskRepeater.itemAt(index);
if (task) {
/**
* BUG 452187: when activating a task from keyboard, there is no
* containsMouse changed signal, so we need to update the tooltip
* properties here.
*/
if (plasmoid.configuration.showToolTips
&& plasmoid.configuration.groupedTaskVisualization === 1) {
task.toolTipAreaItem.updateMainItemBindings();
}
TaskTools.activateTask(task.modelIndex(), task.m, null, task);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment