[Task Manager] Let badge become pill-shaped and limit to 0 through 9,999 items
ClosedPublic

Authored by broulik on Jan 11 2018, 5:30 PM.

Details

Summary

There's no point in showing a gazillion, however, when the number gets bigger, let the circle become pill-shaped.
While at it, also locale-format the number (e.g. thousand separator)

Test Plan

Before


After

In preparation for D9825 the badge with its sizing/radius logic is moved into a separate component

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jan 11 2018, 5:30 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 11 2018, 5:30 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jan 11 2018, 5:30 PM

Why not expand the badge to become pill-shaped so we can accommodate absurdly numbers? That's what macOS does. You might be surprised by now many people have 1000+ unread emails...

Good idea. However, QtQuick Rectangle can only be circular :D but I'll have a look.

hein added a comment.Jan 12 2018, 6:55 AM

Why can it only be circular? It's Rectangle ...

broulik updated this revision to Diff 25202.Jan 12 2018, 9:06 AM
broulik retitled this revision from [Task Manager] Limit badge number to 99 to [Task Manager] Let badge become pill-shaped and limit to 9,999 items.
broulik edited the summary of this revision. (Show Details)
broulik edited the test plan for this revision. (Show Details)
ngraham accepted this revision as: VDG.Jan 12 2018, 2:06 PM

Looks great to me visually! VDG Approved™

That looks really good!

applets/taskmanager/package/contents/ui/Badge.qml
33

Components shouldn't specify their own height, nor should they assume stuff about their parents, it makes them non-portable.

I would get rid of this line. Maybe specify an implicitHeight of: label.implicitHeight.

Apperance will remain identical as you're overwriting the height on line 79 of TaskBadgeOverlay

49

Why 0 instead of a negative?

broulik updated this revision to Diff 25236.Jan 12 2018, 2:52 PM
broulik updated this revision to Diff 25238.Jan 12 2018, 3:03 PM
broulik retitled this revision from [Task Manager] Let badge become pill-shaped and limit to 9,999 items to [Task Manager] Let badge become pill-shaped and limit to 0 through 9,999 items.

Show dash for negative numbers

hein accepted this revision.Jan 14 2018, 7:33 AM
This revision is now accepted and ready to land.Jan 14 2018, 7:33 AM
This revision was automatically updated to reflect the committed changes.