X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-editor-impl.cpp;h=47ee35985c6a16d9fbc09d01355c66b6cc393bd1;hp=fc86c7ea532de0df061251a51aa93e876eb33e61;hb=448bcfa1ab294f28eb9252e2c736c83bc043f9ef;hpb=7f0a28e0f0da67178997e5a647bdc471e8dcb652 diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index fc86c7e..47ee359 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -133,6 +133,8 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "smoothScrollDuration", DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableScrollBar", BOOLEAN, ENABLE_SCROLL_BAR ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollBarShowDuration", FLOAT, SCROLL_BAR_SHOW_DURATION ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollBarFadeDuration", FLOAT, SCROLL_BAR_FADE_DURATION ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "pixelSize", FLOAT, PIXEL_SIZE ) +DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextEditor, "lineCount", INTEGER, LINE_COUNT ) DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED ) DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED ) @@ -231,9 +233,9 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P const float pointSize = value.Get< float >(); DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p POINT_SIZE %f\n", impl.mController.Get(), pointSize ); - if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) ) + if( !Equals( impl.mController->GetDefaultFontSize( Text::Controller::POINT_SIZE ), pointSize ) ) { - impl.mController->SetDefaultPointSize( pointSize ); + impl.mController->SetDefaultFontSize( pointSize, Text::Controller::POINT_SIZE ); } } break; @@ -645,6 +647,20 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P impl.mAnimationPeriod.durationSeconds = duration; break; } + case Toolkit::DevelTextEditor::Property::PIXEL_SIZE: + { + if( impl.mController ) + { + const float pixelSize = value.Get< float >(); + DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p PIXEL_SIZE %f\n", impl.mController.Get(), pixelSize ); + + if( !Equals( impl.mController->GetDefaultFontSize( Text::Controller::PIXEL_SIZE ), pixelSize ) ) + { + impl.mController->SetDefaultFontSize( pixelSize, Text::Controller::PIXEL_SIZE ); + } + } + break; + } } // switch } // texteditor } @@ -702,7 +718,7 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind { if( impl.mController ) { - value = impl.mController->GetDefaultPointSize(); + value = impl.mController->GetDefaultFontSize( Text::Controller::POINT_SIZE ); } break; } @@ -971,6 +987,23 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind value = impl.mAnimationPeriod.durationSeconds; break; } + case Toolkit::DevelTextEditor::Property::PIXEL_SIZE: + { + if( impl.mController ) + { + value = impl.mController->GetDefaultFontSize( Text::Controller::PIXEL_SIZE ); + } + break; + } + case Toolkit::DevelTextEditor::Property::LINE_COUNT: + { + if( impl.mController ) + { + float width = textEditor.GetProperty( Actor::Property::SIZE_WIDTH ).Get(); + value = impl.mController->GetLineCount( width ); + } + break; + } } //switch } @@ -1098,20 +1131,25 @@ void TextEditor::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange: const std::string& newFont = GetImpl( styleManager ).GetDefaultFontFamily(); // Property system did not set the font so should update it. mController->UpdateAfterFontChange( newFont ); + RelayoutRequest(); break; } case StyleChange::DEFAULT_FONT_SIZE_CHANGE: { GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); + RelayoutRequest(); break; } case StyleChange::THEME_CHANGE: { - GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); + // Nothing to do, let control base class handle this break; } } + + // Up call to Control + Control::OnStyleChange( styleManager, change ); } Vector3 TextEditor::GetNaturalSize()