changed.
Change-Id: Iaf226f4128b6b0a2572eb5af5ae1e9bfcb5e8f96
mController->SetNoTextLongPressAction( Controller::NoTextTap::HIGHLIGHT );
// Sets layoutDirection value
mController->SetNoTextLongPressAction( Controller::NoTextTap::HIGHLIGHT );
// Sets layoutDirection value
- Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+ Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( stage.GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
mController->SetLayoutDirection( layoutDirection );
mController->SetLayoutDirection( layoutDirection );
- self.LayoutDirectionChangedSignal().Connect( this, &TextEditor::OnLayoutDirectionChanged );
-
// Forward input events to controller
EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
// Forward input events to controller
EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
-void TextEditor::OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type )
-{
- mController->UpdateLayoutDirectionChanged( type );
-}
-
void TextEditor::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnStyleChange\n");
void TextEditor::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnStyleChange\n");
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/adaptor-framework/input-method-context.h>
#include <dali/public-api/animation/animation.h>
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/adaptor-framework/input-method-context.h>
#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/common/stage.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
void OnScrollIndicatorAnimationFinished( Animation& animation );
/**
void OnScrollIndicatorAnimationFinished( Animation& animation );
/**
- * @brief Callbacks when the layout direction changes
- * @param[in] actor The actor whose layoutDirection is changed.
- * @param[in] type The layoutDirection.
- */
- void OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type );
-
- /**
* Construct a new TextEditor.
*/
TextEditor();
* Construct a new TextEditor.
*/
TextEditor();
mController->SetNoTextLongPressAction( Controller::NoTextTap::HIGHLIGHT );
// Sets layoutDirection value
mController->SetNoTextLongPressAction( Controller::NoTextTap::HIGHLIGHT );
// Sets layoutDirection value
- Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+ Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( stage.GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
mController->SetLayoutDirection( layoutDirection );
mController->SetLayoutDirection( layoutDirection );
- self.LayoutDirectionChangedSignal().Connect( this, &TextField::OnLayoutDirectionChanged );
-
// Forward input events to controller
EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
// Forward input events to controller
EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
-void TextField::OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type )
-{
- mController->UpdateLayoutDirectionChanged( type );
-}
-
void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnStyleChange\n");
void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnStyleChange\n");
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/adaptor-framework/input-method-context.h>
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/adaptor-framework/input-method-context.h>
+#include <dali/public-api/common/stage.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
- * @brief Callbacks when the layout direction changes
- * @param[in] actor The actor whose layoutDirection is changed.
- * @param[in] type The layoutDirection.
- */
- void OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type );
-
- /**
* Construct a new TextField.
*/
TextField();
* Construct a new TextField.
*/
TextField();
mController->SetTextElideEnabled( true ); // If false then text larger than control will overflow
// Sets layoutDirection value
mController->SetTextElideEnabled( true ); // If false then text larger than control will overflow
// Sets layoutDirection value
- Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+ Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( stage.GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
mController->SetLayoutDirection( layoutDirection );
mController->SetLayoutDirection( layoutDirection );
- self.LayoutDirectionChangedSignal().Connect( this, &TextLabel::OnLayoutDirectionChanged );
-
Layout::Engine& engine = mController->GetLayoutEngine();
engine.SetCursorWidth( 0u ); // Do not layout space for the cursor.
}
Layout::Engine& engine = mController->GetLayoutEngine();
engine.SetCursorWidth( 0u ); // Do not layout space for the cursor.
}
-void TextLabel::OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type )
-{
- mController->UpdateLayoutDirectionChanged( type );
-}
-
void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::OnStyleChange\n");
void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::OnStyleChange\n");
// EXTERNAL INCLUDES
#include <dali/public-api/object/property-map.h>
// EXTERNAL INCLUDES
#include <dali/public-api/object/property-map.h>
+#include <dali/public-api/common/stage.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
*/
virtual void ScrollingFinished();
*/
virtual void ScrollingFinished();
- /**
- * @brief Callbacks when the layout direction changes
- * @param[in] actor The actor whose layoutDirection is changed.
- * @param[in] type The layoutDirection.
- */
- void OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type );
-
private: // Implementation
/**
private: // Implementation
/**
UpdateTextType updateTextType = NONE_UPDATED;
UpdateTextType updateTextType = NONE_UPDATED;
- mImpl->mLayoutDirection = layoutDirection;
if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) )
{
if( 0u != mImpl->mModel->mVisualModel->mGlyphPositions.Count() )
if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) )
{
if( 0u != mImpl->mModel->mVisualModel->mGlyphPositions.Count() )
mImpl->mTextUpdateInfo.mCharacterIndex = 0u;
}
mImpl->mTextUpdateInfo.mCharacterIndex = 0u;
}
+ if( mImpl->mModel->mMatchSystemLanguageDirection && mImpl->mLayoutDirection != layoutDirection )
+ {
+ // Clear the update info. This info will be set the next time the text is updated.
+ mImpl->mTextUpdateInfo.mClearAll = true;
+ // Apply modifications to the model
+ mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending |
+ GET_GLYPH_METRICS |
+ SHAPE_TEXT |
+ UPDATE_DIRECTION |
+ LAYOUT |
+ BIDI_INFO |
+ REORDER );
+ mImpl->mLayoutDirection = layoutDirection;
+ }
+
// Make sure the model is up-to-date before layouting.
ProcessModifyEvents();
bool updated = mImpl->UpdateModel( mImpl->mOperationsPending );
// Make sure the model is up-to-date before layouting.
ProcessModifyEvents();
bool updated = mImpl->UpdateModel( mImpl->mOperationsPending );
return mImpl->mShouldClearFocusOnEscape;
}
return mImpl->mShouldClearFocusOnEscape;
}
-void Controller::UpdateLayoutDirectionChanged( Dali::LayoutDirection::Type type )
-{
- mImpl->mLayoutDirection = type;
- mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending |
- BIDI_INFO );
- mImpl->RequestRelayout();
-}
-
// private : Private contructors & copy operator.
Controller::Controller()
// private : Private contructors & copy operator.
Controller::Controller()
*/
bool ShouldClearFocusOnEscape() const;
*/
bool ShouldClearFocusOnEscape() const;
- /**
- * @brief UpdateLayoutDirectionChanged
- */
- void UpdateLayoutDirectionChanged( Dali::LayoutDirection::Type type );
-
protected: // Inherit from Text::Decorator::ControllerInterface.
/**
protected: // Inherit from Text::Decorator::ControllerInterface.
/**