D9827: [Task Manager] Let badge become pill-shaped and limit to 9,999 items

David Edmundson noreply at phabricator.kde.org
Fri Jan 12 14:43:09 UTC 2018


davidedmundson added a comment.


  That looks really good!

INLINE COMMENTS

> Badge.qml:32
> +    implicitWidth: Math.max(height, Math.round(label.contentWidth + radius / 2)) // Add some padding around.
> +    height: Math.round(parent.height * 0.4)
> +    color: theme.highlightColor

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

> Badge.qml:48
> +        text: badgeRect.number > 9999 ? i18nc("Over 9999 new messages, overlay, keep short", "9,999+")
> +                                      : Math.max(0, badgeRect.number).toLocaleString(Qt.locale(), 'f', 0)
> +    }

Why 0 instead of a negative?

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D9827

To: broulik, #plasma, #vdg, hein
Cc: davidedmundson, ngraham, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180112/9d837381/attachment-0001.html>


More information about the Plasma-devel mailing list