[Applet Configuration] Work around bad kerning in sidebar labels
AbandonedPublic

Authored by filipf on Jan 13 2020, 11:36 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 (centering) 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:

It's no longer "Ap pearance" or "Be havi or"

Diff Detail

Repository
R119 Plasma Desktop
Branch
fix-applet-config-sidebar-label-kerning (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21093
Build 21111: arc lint + arc unit
filipf created this revision.Jan 13 2020, 11:36 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 13 2020, 11:36 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Jan 13 2020, 11:36 PM
filipf edited the test plan for this revision. (Show Details)Jan 13 2020, 11:37 PM
filipf added reviewers: Plasma, ngraham.
ngraham requested changes to this revision.Jan 13 2020, 11:43 PM

This workaround breaks with multi-line strings:

This revision now requires changes to proceed.Jan 13 2020, 11:43 PM

Oops, looks like it breaks those smallSpacing margins as well:

Yes you would need to add the margins by reducing the size of the minimum width.

Since we found a reliable workaround, I wonder if we should just use that data to pinpoint the problem in Qt and fix it there... Maybe @mart or @davidedmundson could help with that.

filipf updated this revision to Diff 73474.Jan 13 2020, 11:48 PM
filipf removed subscribers: mart, davidedmundson.
  • make it work with multi line strings
  • restore side margins
filipf edited the summary of this revision. (Show Details)Jan 13 2020, 11:59 PM
ngraham accepted this revision.Jan 14 2020, 1:37 AM

I added a test case to https://bugreports.qt.io/browse/QTBUG-49646, BTW. Maybe that will help the Qt folks find the source of the issue.

This revision is now accepted and ready to land.Jan 14 2020, 1:37 AM