Shows and hides pause button correctly
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Fri, 7 Oct 2011 14:51:56 +0000 (17:51 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Fri, 7 Oct 2011 14:51:56 +0000 (17:51 +0300)
Also when the game is paused because of backgrounding the app.
Pause button not shown before the game starts.

classes/clockswidget.cpp
qml/ClocksPage.qml

index de46005..fd9c702 100644 (file)
@@ -195,6 +195,7 @@ void ClocksWidget::mousePressEvent(QMouseEvent *event)
             welcomeLabel_->setVisible(false);
  //For Harmattan pause button is moved to the toolbar (in QML)
 //            pauseButton_->setVisible(true);
+            emit unPaused(); //To tell QML that game is going (used to show pause button)
             keeper_->keepScreenLit(true);
             white_->startTurn();
             status_ = WhiteTurn;
index 2c2dcb8..3637759 100644 (file)
@@ -45,7 +45,7 @@ Page
     onStatusChanged:
     {
         if (status == PageStatus.Activating)
-            wrappedClocksWidget.startGame(timeControl,whiteInitialTime,whiteAdditionalTime,whiteTurnsPerAddition,blackInitialTime,blackAdditionalTime,blackTurnsPerAddition)
+              wrappedClocksWidget.startGame(timeControl,whiteInitialTime,whiteAdditionalTime,whiteTurnsPerAddition,blackInitialTime,blackAdditionalTime,blackTurnsPerAddition)
     }
 
     property bool appActive: applicationActive
@@ -53,7 +53,10 @@ Page
     onAppActiveChanged:
     {
         if (appActive == false)
+        {
             wrappedClocksWidget.pause()
+            pauseButton.visible = false
+        }
     }
 
     tools: ToolBarLayout