[applets/notifications] Try to not have the notification count numbers overflow the icon
ClosedPublic

Authored by filipf on Thu, Aug 1, 4:17 PM.

Details

Summary

When the notification count is in double digits, the numbers can overflow the icon which is meant to contain them.

This patch checks if there is more than 1 digit and then slightly reduces the size of the numbers.

Test Plan

Cantarell, 10pt

Before:

After:

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
filipf created this revision.Thu, Aug 1, 4:17 PM
Restricted Application added a project: Plasma. · View Herald TranscriptThu, Aug 1, 4:17 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Thu, Aug 1, 4:17 PM
filipf edited the summary of this revision. (Show Details)Thu, Aug 1, 4:18 PM
filipf edited the test plan for this revision. (Show Details)
filipf added reviewers: broulik, Plasma, VDG.
filipf edited the test plan for this revision. (Show Details)
filipf edited the test plan for this revision. (Show Details)Thu, Aug 1, 4:22 PM
broulik added inline comments.Thu, Aug 1, 6:20 PM
applets/notifications/package/contents/ui/CompactRepresentation.qml
97

Can you rearrange that a bit

width: Math.round(Math.min(parent.width, parent.height) * (text.length > 1 ? 0.67 : 0.75))`
filipf updated this revision to Diff 62923.Thu, Aug 1, 6:32 PM

better code

filipf marked an inline comment as done.Thu, Aug 1, 6:33 PM
ngraham accepted this revision.Thu, Aug 1, 7:25 PM
ngraham added a subscriber: ngraham.

Much better.

This revision is now accepted and ready to land.Thu, Aug 1, 7:25 PM
broulik accepted this revision.Fri, Aug 2, 11:35 AM
This revision was automatically updated to reflect the committed changes.