[Widget Explorer] Work around bad kerning
AcceptedPublic

Authored by filipf on Mon, Jan 13, 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.Mon, Jan 13, 6:17 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMon, Jan 13, 6:17 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Mon, Jan 13, 6:17 PM
filipf edited the test plan for this revision. (Show Details)Mon, Jan 13, 6:17 PM
filipf added reviewers: Plasma, ngraham.
ngraham accepted this revision.Mon, Jan 13, 6:31 PM
This revision is now accepted and ready to land.Mon, Jan 13, 6:31 PM
filipf updated this revision to Diff 73462.Mon, Jan 13, 9:21 PM

remove added whitespace

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

don't repeat the same code twice