Commit b4e1688b authored by Bharadwaj Raju's avatar Bharadwaj Raju Committed by Nate Graham
Browse files

Fix zero badges (eg when downloading small files with Firefox)

Sometimes the badge is shown when count is zero. This happens for
example when we download a small file with Firefox. it happens because
countVisible was not always being taken into account. This is corrected.


(cherry picked from commit aafb762d)
parent 11a000af
......@@ -33,12 +33,14 @@ Item {
readonly property int offset: Math.round(Math.max(PlasmaCore.Units.smallSpacing / 2, badgeMask.width / 32))
x: Qt.application.layoutDirection === Qt.RightToLeft ? -offset + iconWidthDelta : parent.width - width + offset - iconWidthDelta
y: -offset
visible: task.smartLauncherItem.countVisible
width: badgeRect.width + offset * 2
height: badgeRect.height + offset * 2
radius: badgeRect.radius + offset * 2
// Badge changes width based on number.
onWidthChanged: maskShaderSource.scheduleUpdate()
onVisibleChanged: maskShaderSource.scheduleUpdate()
}
}
......@@ -82,6 +84,7 @@ Item {
id: badgeRect
x: Qt.application.layoutDirection === Qt.RightToLeft ? iconWidthDelta : parent.width - width - iconWidthDelta
height: Math.round(parent.height * 0.4)
visible: task.smartLauncherItem.countVisible
number: task.smartLauncherItem.count
}
......
Markdown is supported
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