Fix enabling border for ShadowedRectangle on item creation
ClosedPublic

Authored by ahiemstra on Mar 13 2020, 5:43 PM.

Details

Summary

When enabling the border during object creation, the first time updatePaintNode
would be called we'd call setBorderWidth() which switches the node to the bordered
rectangle material, then tries to set the border width, which fails because we have
no geometry rect yet. This splits up setBorderWidth into setBorderEnabled and
setBorderWidth so we can call setBorderEnabled as first thing and setBorderWidth
once a proper rect has been set.

In addition, this also changes the behaviour of border to be completely contained
within the item, to match QtQuick Rectangle behaviour.

Test Plan

D28029 now works properly.

Diff Detail

Repository
R169 Kirigami
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahiemstra created this revision.Mar 13 2020, 5:43 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptMar 13 2020, 5:43 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Mar 13 2020, 5:43 PM
ahiemstra updated this revision to Diff 77709.Mar 16 2020, 9:53 AM
  • Use proper float constants
mart accepted this revision.Mar 16 2020, 10:18 AM
This revision is now accepted and ready to land.Mar 16 2020, 10:18 AM
This revision was automatically updated to reflect the committed changes.