From: Adeel Kazmi Date: Fri, 28 Aug 2015 11:50:35 +0000 (-0700) Subject: Merge "System font family change to update font in TextField" into devel/master X-Git-Tag: dali_1.1.2~17 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=0b168b2809db16cbcc82378fd4b031ba3fde3113;hp=-c Merge "System font family change to update font in TextField" into devel/master --- 0b168b2809db16cbcc82378fd4b031ba3fde3113 diff --combined dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 215bd59,eeb7fa5..eb12543 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/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 ) ); @@@ -210,7 -213,7 +213,7 @@@ 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 )