Set implicit size from source size for image/SVG URL sources.
ClosedPublic

Authored by hein on Mar 23 2017, 9:22 PM.

Details

Summary

This allows users of IconItem to know the aspect ratio of the
source document, which can be used to size the item or set
applet size hints to accomodate non-square images better.

This will be used in a patch to Kicker/Dashboard that ports
a use of Image in its CompactRepresentation to IconItem to
get the hover highlight effect even for a custom button image.

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.
hein created this revision.Mar 23 2017, 9:22 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptMar 23 2017, 9:22 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
drosca added a subscriber: drosca.Mar 23 2017, 9:30 PM

You don't reset the implicitSize anywhere, so if you do setSource(QImage) and then setSource(QIcon) it will still have the implicitSize of the previously set QImage.

hein added a comment.Mar 23 2017, 9:32 PM

That was me being sleepy and trying to be smart and cunning and avoid busywork :)

hein updated this revision to Diff 12755.Mar 23 2017, 9:34 PM

Always update implicit size.

mart accepted this revision.Mar 24 2017, 10:16 AM
This revision is now accepted and ready to land.Mar 24 2017, 10:16 AM
This revision was automatically updated to reflect the committed changes.