don't trigger wallpaper config when pressing on favorites

This commit is contained in:
Marco Martin 2015-04-11 12:59:52 +02:00
parent 46f8a90371
commit e3913eb107
2 changed files with 9 additions and 16 deletions

View file

@ -12,19 +12,7 @@ Item {
property bool isDropTarget: delegateRoot != dragDelegate && root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole == modelData.ApplicationStorageIdRole property bool isDropTarget: delegateRoot != dragDelegate && root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole == modelData.ApplicationStorageIdRole
opacity: isDropTarget ? 0.3 : 1 opacity: isDropTarget ? 0.3 : 1
onModelDataChanged:print("AAAA");
/*function syncDropTarget() {
if (isDropTarget) {
var pos = mapToItem(root, x, y);
dragDelegate.xTarget = pos.x;
dragDelegate.yTarget = pos.y;
print("AAAAA"+pos.x+" "+pos.x+" "+delegateRoot)
}
}
onIsDropTargetChanged: syncDropTarget();
onXChanged: syncDropTarget();
onYChanged: syncDropTarget();*/
PlasmaCore.IconItem { PlasmaCore.IconItem {
id: icon id: icon
anchors.centerIn: parent anchors.centerIn: parent

View file

@ -228,9 +228,11 @@ MouseEventListener {
} }
onReleased: { onReleased: {
applicationsView.interactive = true; applicationsView.interactive = true;
dragDelegate.xTarget = Math.floor(mouse.x / root.buttonHeight) * root.buttonHeight dragDelegate.xTarget = Math.floor(mouse.x / root.buttonHeight) * root.buttonHeight;
dragDelegate.yTarget = Math.floor(mouse.y / root.buttonHeight) * root.buttonHeight dragDelegate.yTarget = Math.floor(mouse.y / root.buttonHeight) * root.buttonHeight;
dragDelegate.opacity = 0; dragDelegate.opacity = 0;
dragDelegate.modelData.ApplicationIconRole = "";
dragDelegate.modelDataChanged();
applicationsView.dragData = null; applicationsView.dragData = null;
root.reorderingApps = false; root.reorderingApps = false;
applicationsView.forceLayout(); applicationsView.forceLayout();
@ -403,8 +405,11 @@ MouseEventListener {
property int margin: stripe.height + units.gridUnit * 2 property int margin: stripe.height + units.gridUnit * 2
onPressAndHold: { onPressAndHold: {
print(favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y)))
if (!favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y))) {
plasmoid.action("configure").trigger(); plasmoid.action("configure").trigger();
} }
}
ColumnLayout { ColumnLayout {
id: mainLayout id: mainLayout