Fix enabling border for ShadowedRectangle on item creation

Authored by ahiemstra on Mar 16 2020, 9:52 AM.

Description

Fix enabling border for ShadowedRectangle on item creation

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.

Reviewers: Kirigami, mart

Reviewed By: Kirigami, mart

Subscribers: plasma-devel

Tags: Kirigami

Differential Revision: https://phabricator.kde.org/D28038

Details

Committed
ahiemstraMar 16 2020, 10:25 AM
Reviewer
Kirigami
Differential Revision
D28038: Fix enabling border for ShadowedRectangle on item creation
Parents
R169:848b5a7345f9: check for window existence
Branches
Unknown
Tags
Unknown