[Widget Explorer] Work around bad kerning
AbandonedPublic

Authored by filipf on Jan 13 2020, 6:17 PM.

Details

Reviewers
ngraham
Group Reviewers
Plasma
Summary

One way that https://bugreports.qt.io/browse/QTBUG-49646 manifests itself is when we have single line labels centered using "horizontalAlignment: Text.AlignHCenter".

This patch works around the kerning bug using a different centering method: using the layout's alignment and setting the maximum width.

Since the workaround doesn't work when there is more than 1 line of text AND since kerning is OK when lineCount > 1, we revert back to the old method in that situation.

Test Plan

Before:

After:

Diff Detail

Repository
R119 Plasma Desktop
Branch
widget-explorer-kerning-fix (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21082
Build 21100: arc lint + arc unit
filipf created this revision.Jan 13 2020, 6:17 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 13 2020, 6:17 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Jan 13 2020, 6:17 PM
filipf edited the test plan for this revision. (Show Details)Jan 13 2020, 6:17 PM
filipf added reviewers: Plasma, ngraham.
ngraham accepted this revision.Jan 13 2020, 6:31 PM
This revision is now accepted and ready to land.Jan 13 2020, 6:31 PM
filipf updated this revision to Diff 73462.Jan 13 2020, 9:21 PM

remove added whitespace

filipf updated this revision to Diff 73463.Jan 13 2020, 9:21 PM

don't repeat the same code twice