textfield height based only on clear text
ClosedPublic

Authored by mart on Mar 7 2019, 5:32 PM.

Details

Summary

as the implicit height could change when switching to password mode,
use a textmetrics which always computes it from the visible text

BUG:399155

Test Plan

height doesn't change

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Mar 7 2019, 5:32 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 7 2019, 5:32 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
mart requested review of this revision.Mar 7 2019, 5:32 PM
ngraham accepted this revision.Mar 7 2019, 5:48 PM
ngraham added a subscriber: ngraham.

It's fixed!!!!

Of course now the issue with the dots is worse since the dots are just too high up in the text field:

However that's an issue in Noto Symbols itself. Aoparently all the characters in the whole font have a descent value that's too large (7 vs 4 for in regular Noto Sans). We're tracking this with https://github.com/googlei18n/noto-fonts/issues/1468. Thanks so much for fixing this, Marco!

This revision is now accepted and ready to land.Mar 7 2019, 5:48 PM
rooty accepted this revision.Mar 7 2019, 5:53 PM
rooty added a subscriber: rooty.

Good things come to those who wait, thanks for the fix.
I can also confirm that this doesn't affect any other font adversely in any way.

sitter added a subscriber: sitter.Mar 8 2019, 10:43 AM

LGTM, but do we need the MMM there? Wouldn't one M do? Or if control.text is always a string we don't need the ""+ at all?

src/declarativeimports/plasmastyle/TextFieldStyle.qml
60–61

maybe add a linebreak between the two sides so it's easy to spot the metrics.height on both sides of the max.

mart updated this revision to Diff 53445.Mar 8 2019, 2:39 PM
  • use just M
mart updated this revision to Diff 53446.Mar 8 2019, 2:40 PM
  • better formatting
This revision was automatically updated to reflect the committed changes.