diff --git a/applets/kickoff/package/contents/ui/KickoffItem.qml b/applets/kickoff/package/contents/ui/KickoffItem.qml --- a/applets/kickoff/package/contents/ui/KickoffItem.qml +++ b/applets/kickoff/package/contents/ui/KickoffItem.qml @@ -29,7 +29,6 @@ id: listItem width: ListView.view.width -// height: listItemDelegate.height // + listItemDelegate.anchors.margins*2 height: (units.smallSpacing * 2) + Math.max(elementIcon.height, titleElement.height + subTitleElement.height) signal actionTriggered(string actionId, variant actionArgument) @@ -93,82 +92,73 @@ } } - Item { - id: listItemDelegate - + MouseArea { + id: mouseArea anchors { left: parent.left right: parent.right top: parent.top bottom: parent.bottom - //margins: units.smallSpacing } - MouseArea { - id: mouseArea - - anchors.fill: parent - //anchors.margins: -8 + property bool pressed: false + property int pressX: -1 + property int pressY: -1 - property bool pressed: false - property int pressX: -1 - property int pressY: -1 + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton - hoverEnabled: true - acceptedButtons: Qt.LeftButton | Qt.RightButton + onEntered: { + listItem.ListView.view.currentIndex = index; + } - onEntered: { - listItem.ListView.view.currentIndex = index; - } + onExited: { + listItem.ListView.view.currentIndex = -1; + } - onExited: { - listItem.ListView.view.currentIndex = -1; + onPressed: { + if (mouse.buttons & Qt.RightButton) { + if (hasActionList) { + openActionMenu(mouseArea, mouse.x, mouse.y); + } + } else { + pressed = true; + pressX = mouse.x; + pressY = mouse.y; } + } - onPressed: { - if (mouse.buttons & Qt.RightButton) { - if (hasActionList) { - openActionMenu(mouseArea, mouse.x, mouse.y); - } + onReleased: { + if (pressed) { + if (appView) { + appViewScrollArea.state = "OutgoingLeft"; } else { - pressed = true; - pressX = mouse.x; - pressY = mouse.y; + listItem.activate(); } - } - onReleased: { - if (pressed) { - if (appView) { - appViewScrollArea.state = "OutgoingLeft"; - } else { - listItem.activate(); - } + listItem.ListView.view.currentIndex = -1; + } - listItem.ListView.view.currentIndex = -1; - } + pressed = false; + pressX = -1; + pressY = -1; + } + onPositionChanged: { + if (pressX != -1 && model.url && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) { + kickoff.dragSource = listItem; + dragHelper.startDrag(root, model.url, model.decoration); pressed = false; pressX = -1; pressY = -1; } + } - onPositionChanged: { - if (pressX != -1 && model.url && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) { - kickoff.dragSource = listItem; - dragHelper.startDrag(root, model.url, model.decoration); - pressed = false; - pressX = -1; - pressY = -1; - } - } - - onContainsMouseChanged: { - if (!containsMouse) { - pressed = false; - pressX = -1; - pressY = -1; - } + onContainsMouseChanged: { + if (!containsMouse) { + pressed = false; + pressX = -1; + pressY = -1; } }