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

Authored by filipf on Aug 1 2019, 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.Aug 1 2019, 4:17 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 1 2019, 4:17 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Aug 1 2019, 4:17 PM
filipf edited the summary of this revision. (Show Details)Aug 1 2019, 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)Aug 1 2019, 4:22 PM
broulik added inline comments.Aug 1 2019, 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.Aug 1 2019, 6:32 PM

better code

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

Much better.

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