From 25bb220724d7de89e9f022c718999e75e39bdb9a Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Wed, 9 Apr 2014 16:01:23 +0200 Subject: [PATCH] Propagate containsMouse property and move the paddingitem to the mousearea Reviewed by Marco Martin on irc --- .../plasmacomponents/qml/ListItem.qml | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/declarativeimports/plasmacomponents/qml/ListItem.qml b/src/declarativeimports/plasmacomponents/qml/ListItem.qml index 550e0852a..4e6d5e7d0 100644 --- a/src/declarativeimports/plasmacomponents/qml/ListItem.qml +++ b/src/declarativeimports/plasmacomponents/qml/ListItem.qml @@ -71,6 +71,11 @@ Item { //is this to be used as section delegate? property bool sectionDelegate: false + /** + * True if the list item contains mouse + */ + property alias containsMouse: itemMouse.containsMouse + width: parent ? parent.width : childrenRect.width height: paddingItem.childrenRect.height + background.margins.top + background.margins.bottom @@ -120,16 +125,16 @@ Item { onPressed: if (changeBackgroundOnPress) background.prefix = "pressed" onReleased: if (changeBackgroundOnPress) background.prefix = "normal" onCanceled: if (changeBackgroundOnPress) background.prefix = "normal" - } - Item { - id: paddingItem - anchors { - fill: background - leftMargin: background.margins.left - topMargin: background.margins.top - rightMargin: background.margins.right - bottomMargin: background.margins.bottom + Item { + id: paddingItem + anchors { + fill: parent + leftMargin: background.margins.left + topMargin: background.margins.top + rightMargin: background.margins.right + bottomMargin: background.margins.bottom + } } } }