diff --git a/src/controls/templates/SwipeListItem.qml b/src/controls/templates/SwipeListItem.qml --- a/src/controls/templates/SwipeListItem.qml +++ b/src/controls/templates/SwipeListItem.qml @@ -225,25 +225,21 @@ //BEGIN signal handlers onBackgroundChanged: { - background.parent = itemMouse; - background.anchors.fill = itemMouse; - background.z = 0; + if (background) { + background.parent = itemMouse; + background.anchors.fill = itemMouse; + background.z = -1; + } } onContentItemChanged: { contentItem.parent = paddingItem - contentItem.z = 0; + contentItem.z = 1; } Component.onCompleted: { - - if (background) { - background.parent = itemMouse; - background.z = 0; - } - - contentItem.parent = itemMouse - contentItem.z = 1; + backgroundChanged(); + contentItemChanged(); } onPositionChanged: { @@ -344,7 +340,7 @@ Item { id: mainItem - width: (mainFlickable.width * 2) - height + width: (mainFlickable.width * 2) - handleMouse.width height: mainFlickable.height MouseArea { id: itemMouse @@ -363,20 +359,21 @@ anchors { fill: parent margins: Units.smallSpacing + rightMargin: handleIcon.width + Units.smallSpacing } } } MouseArea { id: handleMouse anchors { left: itemMouse.right + right: itemMouse.right top: parent.top bottom: parent.bottom leftMargin: -height } preventStealing: true - width: mainFlickable.width - actionsLayout.width - actionsLayout.anchors.rightMargin property var downTimestamp; property int startX property int startMouseX @@ -407,11 +404,10 @@ } Icon { id: handleIcon - anchors.verticalCenter: parent.verticalCenter + anchors.centerIn: parent selected: listItem.checked || (listItem.pressed && !listItem.checked && !listItem.sectionDelegate) width: Units.iconSizes.smallMedium height: width - x: y source: (mainFlickable.contentX > mainFlickable.width / 2) ? "handle-right" : "handle-left" } }