[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace/kickoff-qml] plasma/desktop/applets/kickoff/package/contents/ui: fix menu positioning
From:       Marco Martin <notmart () gmail ! com>
Date:       2012-10-23 17:08:16
Message-ID: 20121023170816.AAB79A6078 () git ! kde ! org
[Download RAW message or body]

Git commit 9ad0a46b110b76a9640c38f0954398e4de2b39f3 by Marco Martin.
Committed on 23/10/2012 at 19:07.
Pushed by mart into branch 'kickoff-qml'.

fix menu positioning

M  +1    -0    plasma/desktop/applets/kickoff/package/contents/ui/ContextMenu.qml
M  +5    -4    plasma/desktop/applets/kickoff/package/contents/ui/KickoffItem.qml

http://commits.kde.org/kde-workspace/9ad0a46b110b76a9640c38f0954398e4de2b39f3

diff --git a/plasma/desktop/applets/kickoff/package/contents/ui/ContextMenu.qml \
b/plasma/desktop/applets/kickoff/package/contents/ui/ContextMenu.qml index \
                8e799dc..e1dfedd 100644
--- a/plasma/desktop/applets/kickoff/package/contents/ui/ContextMenu.qml
+++ b/plasma/desktop/applets/kickoff/package/contents/ui/ContextMenu.qml
@@ -45,6 +45,7 @@ PlasmaComponents.ContextMenu {
         icon: contextMenu.model.decoration
         font.bold: true
         checkable: false
+        enabled: false
     }
     PlasmaComponents.MenuItem {
         id: titleSeparator
diff --git a/plasma/desktop/applets/kickoff/package/contents/ui/KickoffItem.qml \
b/plasma/desktop/applets/kickoff/package/contents/ui/KickoffItem.qml index \
                bbfaaf7..9d468b2 100644
--- a/plasma/desktop/applets/kickoff/package/contents/ui/KickoffItem.qml
+++ b/plasma/desktop/applets/kickoff/package/contents/ui/KickoffItem.qml
@@ -125,6 +125,7 @@ Item {
                     text: index
                 }
             MouseArea {
+                id: mouseArea
                 anchors.fill: parent
                 hoverEnabled: true
                 acceptedButtons: Qt.LeftButton | Qt.RightButton
@@ -132,16 +133,16 @@ Item {
                     listItem.ListView.view.currentIndex = index;
                 }
                 onClicked: {
-                    if (mouse.button == Qt.LeftButton)
+                    if (mouse.button == Qt.LeftButton) {
                         activate();
-                    else if (mouse.button == Qt.RightButton) {
+                    } else if (mouse.button == Qt.RightButton) {
                         // don't show a context menu for container
                         if (hasModelChildren || typeof(contextMenu) === "undefined") \
{  return;
                         }
 
-                        var mapPos = listItem.mapToItem(listItem, mouse.x, mouse.y);
-                        contextMenu.openAt(titleElement.text, model, mapPos.x, \
mapPos.y); +                        contextMenu.visualParent = mouseArea
+                        contextMenu.openAt(titleElement.text, model, mouse.x, \
mouse.y);  }
                 }
             }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic