Merge "System font family change to update font in TextField" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 28 Aug 2015 11:50:35 +0000 (04:50 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 28 Aug 2015 11:50:35 +0000 (04:50 -0700)
1  2 
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp

@@@ -149,6 -149,9 +149,9 @@@ void TextField::SetProperty( BaseObject
  {
    Toolkit::TextField textField = Toolkit::TextField::DownCast( Dali::BaseHandle( object ) );
  
+   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField SetProperty\n");
    if( textField )
    {
      TextField& impl( GetImpl( textField ) );
  
            if( impl.mController->GetDefaultFontFamily() != fontFamily )
            {
-             impl.mController->SetDefaultFontFamily( fontFamily );
+             impl.mController->SetDefaultFontFamily( fontFamily, true ); // "true" as SetProperty means user defined font so don't change when system font changes.
            }
          }
          break;
@@@ -929,12 -932,10 +932,10 @@@ void TextField::OnStyleChange( Toolkit:
     {
       case StyleChange::DEFAULT_FONT_CHANGE:
       {
-        DALI_LOG_INFO( gLogFilter, Debug::General, "TextField::OnStyleChange StyleChange::DEFAULT_FONT_CHANGE\n");
-        if ( mController->GetDefaultFontFamily() == "" )
-        {
-          // Property system did not set the font so should update it.
-          // todo instruct text-controller to update model
-        }
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnStyleChange DEFAULT_FONT_CHANGE\n");
+        std::string newFont = styleManager.GetDefaultFontFamily();
+        // Property system did not set the font so should update it.
+        mController->UpdateAfterFontChange( newFont );
         break;
       }
  
@@@ -969,6 -970,8 +970,8 @@@ float TextField::GetHeightForWidth( flo
  
  void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
  {
+   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField OnRelayout\n");
    if( mController->Relayout( size ) ||
        !mRenderer )
    {
@@@ -1130,15 -1133,7 +1133,15 @@@ void TextField::OnPan( const PanGesture
  
  void TextField::OnLongPress( const LongPressGesture& gesture )
  {
 +  // Show the keyboard if it was hidden.
 +  if (!VirtualKeyboard::IsVisible())
 +  {
 +    VirtualKeyboard::Show();
 +  }
 +
    mController->LongPressEvent( gesture.state, gesture.localPoint.x, gesture.localPoint.y );
 +
 +  SetKeyInputFocus();
  }
  
  bool TextField::OnKeyEvent( const KeyEvent& event )