homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp
changeset 85 35368b604b28
parent 77 4b195f3bea29
child 92 6727c5d0afc7
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp	Wed Aug 18 09:40:07 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp	Thu Sep 02 20:17:27 2010 +0300
@@ -337,7 +337,7 @@
     animation->setEndValue(pageLayerXPos(targetPageIndex));
     animation->setDuration(duration);
     
-    if (abs(mDeltaX) < HSCONFIGURATION_GET(pageChangePanDistanceInPixels)) {
+    if (abs(mDeltaX) < HSCONFIGURATION_GET(pageChangePanDistance)) {
         animation->setEasingCurve(HSCONFIGURATION_GET(bounceAnimationEasingCurve)); 
     }
     else {
@@ -526,7 +526,7 @@
     */
     QVariant homescreenData(mPageHotSpot);
     machine()->postEvent(
-        HsMenuEventFactory::createOpenAppLibraryEvent(AddHsMenuMode, homescreenData));
+        HsMenuEventFactory::createOpenAppLibraryEvent(Hs::AddHsMenuMode, homescreenData));
     mPageHotSpot = QPointF();
 }
 
@@ -536,7 +536,7 @@
 void HsIdleState::onAddContentFromOptionsMenuActionTriggered()
 {
     machine()->postEvent(
-         HsMenuEventFactory::createOpenAppLibraryEvent(AddHsMenuMode));
+         HsMenuEventFactory::createOpenAppLibraryEvent(Hs::AddHsMenuMode));
 }
 
 /*!
@@ -657,17 +657,17 @@
     if (HSCONFIGURATION_GET(isSnapEnabled)) {
         mSnapResult = HsWidgetPositioningOnWidgetMove::instance()->run(widget->visual()->sceneBoundingRect());
 
+        bool isTrashbinOpen = HsGui::instance()->idleWidget()->trashBin()->isUnderMouse();
+
         if (HSCONFIGURATION_GET(isSnapEffectsEnabled)) {
-            if (mSnapResult.hasHorizontalSnap) {
+            if (mSnapResult.hasHorizontalSnap && !isTrashbinOpen) {
                 showVerticalLine();
-            }
-            else {
+            } else {
                 hideVerticalLine();
             }
-            if (mSnapResult.hasVerticalSnap) {
+            if (mSnapResult.hasVerticalSnap && !isTrashbinOpen) {
                 showHorizontalLine();
-                }
-            else {
+            } else {
                 hideHorizontalLine();
             }
         }
@@ -954,9 +954,9 @@
     if (HSCONFIGURATION_GET(isSnapEnabled)) {
 
         QVariantHash snapConfiguration;
-        snapConfiguration[SNAPENABLED] = QString::number(HSCONFIGURATION_GET(isSnapEnabled));
-        snapConfiguration[SNAPFORCE] = QString::number(HSCONFIGURATION_GET(snapForce));
-        snapConfiguration[SNAPGAP] = QString::number(HSCONFIGURATION_GET(snapGap));
+        snapConfiguration[Hs::snapEnabled] = QString::number(HSCONFIGURATION_GET(isSnapEnabled));
+        snapConfiguration[Hs::snapForce] = QString::number(HSCONFIGURATION_GET(snapForce));
+        snapConfiguration[Hs::snapGap] = QString::number(HSCONFIGURATION_GET(snapGap));
         HsWidgetPositioningOnWidgetMove::instance()->setConfiguration(snapConfiguration);
 
         updatePagePresentationToWidgetSnap();
@@ -1126,9 +1126,9 @@
 
     int pageIndex = HsScene::instance()->activePageIndex();
 
-    if (mDeltaX < -HSCONFIGURATION_GET(pageChangePanDistanceInPixels)) {
+    if (mDeltaX < -HSCONFIGURATION_GET(pageChangePanDistance)) {
         pageIndex = qMin(pageIndex + 1, pages.count() - 1);
-    } else if (HSCONFIGURATION_GET(pageChangePanDistanceInPixels) < mDeltaX) {
+    } else if (HSCONFIGURATION_GET(pageChangePanDistance) < mDeltaX) {
         pageIndex = qMax(pageIndex - 1, 0);
     }
 
@@ -1212,10 +1212,13 @@
     bool isLastPage(scene->activePage() == scene->pages().last());
     
     int nextPageIndex(pageToRemoveIndex);
-    nextPageIndex++;
+   
     if (isLastPage) {
         nextPageIndex--; 
+    } else {
+        nextPageIndex++;
     }
+
     HsPropertyAnimationWrapper *animation = HsGui::instance()->pageChangeAnimation();
     if (animation->isRunning()) {
         animation->stop();