src/hbcore/gui/hbpopupmanager.cpp
changeset 28 b7da29130b0e
parent 23 e6ad4ef83b23
child 30 80e4d18b72f5
--- a/src/hbcore/gui/hbpopupmanager.cpp	Thu Sep 02 20:44:51 2010 +0300
+++ b/src/hbcore/gui/hbpopupmanager.cpp	Fri Sep 17 08:32:10 2010 +0300
@@ -276,7 +276,9 @@
 */
 void HbPopupManagerPrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
 {
-    foreach (QGraphicsItem *item, scene->items(mouseEvent->scenePos())) {
+    //This function can be removed since popup background is handling the events
+    Q_UNUSED(mouseEvent);
+    /*foreach (QGraphicsItem *item, scene->items(mouseEvent->scenePos())) {
         if (eventBlockItem(item)) {
             break;
         }
@@ -287,7 +289,7 @@
                 break;
             }
         }
-    }
+    }*/
 }
 
 /*
@@ -344,9 +346,11 @@
 
 void HbPopupManagerPrivate::eventHook(QEvent *event)
 {
-    if (event && event->type() == QEvent::GraphicsSceneMouseRelease && popupList.count() && scene) {
+    Q_UNUSED(event);
+    //This function can be removed since popup background is handling the events
+   /* if (event && event->type() == QEvent::GraphicsSceneMouseRelease && popupList.count() && scene) {
         mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
-    }
+    }*/
 }
 
 void HbPopupManagerPrivate::showPopup(HbPopup *popup)
@@ -418,9 +422,9 @@
     //only if its in its destruction
     bool popupInDestruction = (HbPopupPrivate::d_ptr(popup))->inDestruction;
     if ( parentItems.contains( popup ) && (popupInDestruction)) {
-        //HbPopupLayoutManager *parentItem = parentItems[popup];        
+        HbPopupLayoutManager *parentItem = parentItems[popup];
         parentItems.remove( popup );
-        //delete parentItem;
+        delete parentItem;
     }
 
     // Only execute if close if popup was in popupList before
@@ -445,11 +449,13 @@
         bool wasActivePopup = true;
         // If the previous popup was an inactive panel, then it would not have
         // gained focused. So no need to set the focus to the next topmost popup.
-        if (popup->isPanel() && !popup->isActive()) {
+        if (popup->isPanel() && !HbPopupPrivate::d_ptr(popup)->mActivePopup) {
             wasActivePopup = false;
         }
         if (topLevelFocusablePopup && wasActivePopup ) {
             topLevelFocusablePopup->setFocus();
+            if (HbPopupPrivate::d_ptr(topLevelFocusablePopup)->mActivePopup)
+                topLevelFocusablePopup->setActive(true);
         }
         //TODO: this is not very efficient way of deciding if has already been deleted or not
         else if (initialFocusedItem && scene &&
@@ -558,7 +564,9 @@
 
 void HbPopupManager::eventHook(QEvent *event)
 {
-    d->eventHook(event);
+    //This function can be removed
+    Q_UNUSED(event);
+    //d->eventHook(event);
 }
 
 void HbPopupManager::showPopup(HbPopup *popup)