Commit bb0dae96 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/taskmanager: use a real progressbar for task progress

This allows a screen reader to read the changed value.
parent 9c0772c4
Pipeline #208931 passed with stage
in 5 minutes and 46 seconds
......@@ -76,9 +76,6 @@ MouseArea {
}
let smartLauncherDescription = "";
if (taskProgressOverlayLoader.active) {
smartLauncherDescription += i18nc("@info:tooltip", "Progress for the current Task is %1 percent.", task.smartLauncherItem.progress);
}
if (taskBadgeOverlayLoader.active) {
smartLauncherDescription += i18ncp("@info:tooltip", "There is %1 new message.", "There are %1 new messages.", task.smartLauncherItem.count);
}
......@@ -437,8 +434,13 @@ MouseArea {
anchors.fill: frame
asynchronous: true
source: "TaskProgressOverlay.qml"
active: task.isWindow && task.smartLauncherItem && task.smartLauncherItem.progressVisible
sourceComponent: TaskProgressOverlay {
from: 0
to: 100
value: task.smartLauncherItem.progress
}
}
Item {
......
......@@ -5,32 +5,36 @@
*/
import QtQuick 2.15
import QtQuick.Templates 2.15 as T
import org.kde.plasma.core 2.0 as PlasmaCore
import "code/tools.js" as TaskTools
Item {
id: background
T.ProgressBar {
id: control
Item {
id: progress
anchors {
top: parent.top
left: parent.left
bottom: parent.bottom
}
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
hoverEnabled: false
width: parent.width * (task.smartLauncherItem.progress / 100)
contentItem: Item {
clip: true
PlasmaCore.FrameSvgItem {
id: progressFrame
width: background.width
height: background.height
anchors.left: parent.left
width: parent.width * control.position
height: parent.height
imagePath: "widgets/tasks"
prefix: TaskTools.taskPrefix("progress").concat(TaskTools.taskPrefix("hover"))
}
}
background: Item {}
}
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