Vertically center tooltip icon/image
ClosedPublic

Authored by ngraham on Feb 10 2020, 5:57 PM.

Details

Summary

Right now the widget tooltip's icon/image is top-aligned, which in practice makes it
vertically centered when the tooltip has only one line of text, but not vertically
centered when there are two lines of text.

This patch makes it vertally centered all the time, improving the appearance.

Test Plan

Before:

After:

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.
ngraham created this revision.Feb 10 2020, 5:57 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 10 2020, 5:57 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ngraham requested review of this revision.Feb 10 2020, 5:57 PM
filipf accepted this revision.Feb 10 2020, 5:59 PM
This revision is now accepted and ready to land.Feb 10 2020, 5:59 PM
ndavis accepted this revision.Feb 10 2020, 6:00 PM
ndavis added inline comments.
src/declarativeimports/core/private/DefaultToolTip.qml
57

Do you actually need Qt.AlignHCenter? Isn't there some margin setting that decides how the text is placed relative to the icon?

ngraham added inline comments.Feb 10 2020, 6:08 PM
src/declarativeimports/core/private/DefaultToolTip.qml
57

Text isn't involved here; setting both vertical and horizontal alignment properties ensures that the image or icon is centered in its cell.

This revision was automatically updated to reflect the committed changes.