FrameSvgItem: catch margin changes of FrameSvg also outside own methods
ClosedPublic

Authored by kossebau on Mar 13 2019, 11:30 PM.

Details

Summary

FrameSvg updates the margins e.g. on a Theme change already in its
internal event handling before the methods of FrameSvgItem are invoked.
Due to that CheckMarginsChange guards before this change could not detect
any changes, and thus missed to trigger an update via the margin objects
to the QtQuick world.

So when changing the theme e.g. in a Plasma shell or in the Plasma Theme
Explorer, existing FrameSvg items are using outdated margins, resulting
in broken display.

By keeping a copy of the last seen margins as part of the item and not only
per method, changes outside the FrameSvgItem items can be properly detected.

Test Plan

Switch Plasma themes between Air, Breeze & Oxygen, see how different margins
are reflected in the widgets sizes instantly.
Switch Plasma themes in the Plasma Theme Explorer, with "Show Margins"
enabled, see how margins are always correctly updated intead of taking the
value of the last theme used.

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.
kossebau created this revision.Mar 13 2019, 11:30 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 13 2019, 11:30 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
kossebau requested review of this revision.Mar 13 2019, 11:30 PM
mart accepted this revision.Mar 22 2019, 10:30 AM
This revision is now accepted and ready to land.Mar 22 2019, 10:30 AM
This revision was automatically updated to reflect the committed changes.