Replace TextView with TextLabel
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / navigation-frame / navigation-title-bar.cpp
index 1d65378..e8ce9e0 100644 (file)
@@ -55,6 +55,9 @@ NavigationTitleBar::NavigationTitleBar(NavigationControl& naviControl,
   // title icon layout: the top row, the bottom row and the left column are all for margins
   mTitleIconLayout= Toolkit::TableView::New( 3,2 );
   SetFixedSizes();
+
+  mTitle = Toolkit::TextLabel::New();
+  mSubTitle = Toolkit::TextLabel::New();
 }
 
 void NavigationTitleBar::Update( Toolkit::Page page )
@@ -105,6 +108,21 @@ void NavigationTitleBar::Update( Toolkit::Page page )
     mLayout.AddChild(mButtonLayout, Toolkit::TableView::CellPosition(0,2));
   }
 
+  // add title and subtitle(if exist)
+  mTitle.SetProperty( Toolkit::TextLabel::Property::TEXT, page.GetTitle() );
+  if( page.GetSubTitle().empty() )  //display title
+  {
+    mTitleLayout.SetFixedHeight( 1,mCurrentStyle->titleHeightWithoutSubtitle - mCurrentStyle->subtitleHeight );
+    mTitleLayout.AddChild( mTitle, Toolkit::TableView::CellPosition(1,0,2,1) );
+  }
+  else //display title and subtitle
+  {
+    mTitleLayout.SetFixedHeight( 1, mCurrentStyle->titleHeightWithSubtitle );
+    mTitleLayout.AddChild( mTitle, Toolkit::TableView::CellPosition(1,0) );
+    mSubTitle.SetProperty( Toolkit::TextLabel::Property::TEXT, page.GetSubTitle() );
+    mTitleLayout.AddChild( mSubTitle, Toolkit::TableView::CellPosition(2,0) );
+  }
+
   // insert title icon to the left of the title(if exist)
   if( page.GetTitleIcon() )
   {