(Builder) Back button goes back to main menu rather than exit
[platform/core/uifw/dali-demo.git] / examples / builder / examples.cpp
index d3c7f05..b2c1106 100644 (file)
@@ -404,7 +404,14 @@ public:
   {
     TextView t = TextView::New();
     t.SetMarkupProcessingEnabled(true);
-    t.SetText( std::string("<font size=6>") + ShortName( text ) + std::string("</font>") );
+
+    int size = static_cast<int>(DemoHelper::ScalePointSize(6));
+
+    std::ostringstream fontString;
+    fontString << "<font size="<< size <<">"<<  ShortName( text ) << "</font>";
+
+    t.SetText( fontString.str() );
+
     t.SetTextAlignment( Alignment::HorizontalLeft );
     return t;
   }
@@ -559,7 +566,14 @@ public:
     {
       if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
       {
-        mApp.Quit();
+        if ( mItemView.IsVisible() )
+        {
+          mApp.Quit();
+        }
+        else
+        {
+          EnterSelection();
+        }
       }
     }
   }
@@ -600,9 +614,12 @@ private:
 //------------------------------------------------------------------------------
 int main(int argc, char **argv)
 {
-  if(argc > 1)
+  if(argc > 2)
   {
-    USER_DIRECTORY = argv[1];
+    if(strcmp(argv[1], "-f") == 0)
+    {
+      USER_DIRECTORY = argv[2];
+    }
   }
 
   Application app = Application::New(&argc, &argv);