Commit 20a5ab71 authored by Fushan Wen's avatar Fushan Wen 💬 Committed by Nate Graham
Browse files

applets/taskmanager: improve `Accessible.description` for grouped tasks

This checks `groupedTaskVisualization` option and returns the
matched description for the actual action.

Ref: plasma/plasma-desktop#41
parent 4d835be8
Pipeline #204597 failed with stage
in 3 minutes and 26 seconds
......@@ -66,7 +66,34 @@ MouseArea {
|| (!!tasks.groupDialog && tasks.groupDialog.visualParent === task)
Accessible.name: task.labelText
Accessible.description: task.labelText ? i18n("Activate %1", task.labelText) : ""
Accessible.description: {
if (!task.labelText) {
return "";
}
if (model.IsGroupParent) {
switch (plasmoid.configuration.groupedTaskVisualization) {
case 0:
break; // Use the default description
case 1: {
if (plasmoid.configuration.showToolTips) {
return i18nc("@info:usagetip %1 task name", "Show Task tooltip for %1", task.labelText);
}
// fallthrough
}
case 2: {
if (backend.windowViewAvailable) {
return i18nc("@info:usagetip %1 task name", "Show windows side by side for %1", task.labelText);
}
// fallthrough
}
default:
return i18nc("@info:usagetip %1 task name", "Open textual list of windows for %1", task.labelText);
}
}
return i18n("Activate %1", task.labelText)
}
Accessible.role: Accessible.Button
onHighlightedChanged: {
......
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