From 6af7f672f096ad4de44568a48810b509379408e8 Mon Sep 17 00:00:00 2001 From: Paul Wisbey Date: Wed, 22 Apr 2015 15:25:30 +0100 Subject: [PATCH] TextField property updates Change-Id: I5ee0b8ef3e7e0b9760a4731f05fb479dfe123be8 --- dali-toolkit/images/insertpoint-icon-pressed.png | Bin 0 -> 5035 bytes .../controls/text-controls/text-field-impl.cpp | 346 ++++++++++++++++++--- .../controls/text-controls/text-label-impl.cpp | 2 +- .../internal/text/decorator/text-decorator.cpp | 148 +++++---- .../internal/text/decorator/text-decorator.h | 49 ++- .../internal/text/text-controller-impl.cpp | 4 +- .../public-api/controls/text-controls/text-field.h | 43 ++- 7 files changed, 465 insertions(+), 127 deletions(-) create mode 100644 dali-toolkit/images/insertpoint-icon-pressed.png diff --git a/dali-toolkit/images/insertpoint-icon-pressed.png b/dali-toolkit/images/insertpoint-icon-pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..171b7374d6443e932e07bab996fcdddfe6ccd2d3 GIT binary patch literal 5035 zcmV;c6IASpP)Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4OBs3;+Bb(;~!4V!2o<6ys46agIcq zjPo+3B8fthDa9qy|77CdEc*jK-!%ZRYCZvbku9iQV*~a}ClFY4z~c7+0P?$U!PF=S z1Au6Q;m>#f??3%Vpd|o+W=WE9003S@Bra6Svp>fO002awfhw>;8}z{#EWidF!3EsG z3;bXU&9EIRU@z1_9W=mEXoiz;4lcq~xDGvV5BgyU zp1~-*fe8db$Osc*A=-!mVv1NJjtCc-h4>-CNCXm#Bp}I%6j35eku^v$Qi@a{RY)E3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hhe72}+JE=yDP ztmY~J;+!%B{!{-&bGU5+8UblyO2~7NvRA(t>^Qfj7x+;sz))Bci3f&eP3E0WLBODzT_Pge!z&Ci9d2{EW>8|X9RdIu( z!vbA{rL|wiQB-ML{00908~%CRWU%iT6|?6~60DNv&27%7?+E}FR~F!|x-}unZAfZb zo{u6W;rOo^3QH;&|IA4@@1rqkeZV=^e<-acIxVmc7cw%8uEFWJL`i|BJF*|MV=Ped z2%6KTNrf~~@d&z>_~Py46O=S3Bp0Phc-R#;>?@ffij0LZ<>xb~ao?*td$ygjXT4r8 zFhc)`K&np>LZNHf2OCSeQ%Hs1t7m8iHC~(KDWfnyNbs~I61TT$h$n0MtYSw7Xgont zF~72u|Mi_@C~Uv9tnxc?msC!y0!VZ6V;RluqxxDO*P7A9h|{j-+g&)R?C+e+;hNKJ zTQ<)4q(U*hf3xDU>Sr&j7VpX^b=nLnl(<6UD`2mbo+%ZySEh>zJ30_zWHc~sz!iJ+ zbJMc|*iY&|dNh^R{xiYeIE?}CPvT2_1ov{W{{y%Q08lrQg_QsR002ovPDHLkV1m|4 Bu;~B* literal 0 HcmV?d00001 diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 48ee476..5074cdc 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -79,22 +79,33 @@ BaseHandle Create() // Setup properties, signals and actions using the type-registry. DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextField, Toolkit::Control, Create ); -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "rendering-backend", INTEGER, RENDERING_BACKEND ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text", STRING, PLACEHOLDER_TEXT ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text", STRING, TEXT ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-family", STRING, FONT_FAMILY ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-style", STRING, FONT_STYLE ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "point-size", FLOAT, POINT_SIZE ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "exceed-policy", INTEGER, EXCEED_POLICY ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "primary-cursor-color", VECTOR4, PRIMARY_CURSOR_COLOR ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "secondary-cursor-color", VECTOR4, SECONDARY_CURSOR_COLOR ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "enable-cursor-blink", BOOLEAN, ENABLE_CURSOR_BLINK ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-interval", FLOAT, CURSOR_BLINK_INTERVAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-duration", FLOAT, CURSOR_BLINK_DURATION ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-image", STRING, GRAB_HANDLE_IMAGE ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box", RECTANGLE, DECORATION_BOUNDING_BOX ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "horizontal-alignment", STRING, HORIZONTAL_ALIGNMENT ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "vertical-alignment", STRING, VERTICAL_ALIGNMENT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "rendering-backend", INTEGER, RENDERING_BACKEND ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text", STRING, PLACEHOLDER_TEXT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text", STRING, TEXT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-family", STRING, FONT_FAMILY ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-style", STRING, FONT_STYLE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "point-size", FLOAT, POINT_SIZE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "exceed-policy", INTEGER, EXCEED_POLICY ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "horizontal-alignment", STRING, HORIZONTAL_ALIGNMENT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "vertical-alignment", STRING, VERTICAL_ALIGNMENT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text-color", VECTOR4, TEXT_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow-offset", VECTOR2, SHADOW_OFFSET ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow-color", VECTOR4, SHADOW_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "primary-cursor-color", VECTOR4, PRIMARY_CURSOR_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "secondary-cursor-color", VECTOR4, SECONDARY_CURSOR_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "enable-cursor-blink", BOOLEAN, ENABLE_CURSOR_BLINK ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-interval", FLOAT, CURSOR_BLINK_INTERVAL ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-duration", FLOAT, CURSOR_BLINK_DURATION ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-image", STRING, GRAB_HANDLE_IMAGE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-pressed-image", VECTOR4, GRAB_HANDLE_PRESSED_IMAGE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-threshold", FLOAT, SCROLL_THRESHOLD ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-speed", FLOAT, SCROLL_SPEED ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-left", STRING, SELECTION_HANDLE_IMAGE_LEFT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right", STRING, SELECTION_HANDLE_IMAGE_RIGHT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left", STRING, SELECTION_HANDLE_PRESSED_IMAGE_LEFT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING, SELECTION_HANDLE_PRESSED_IMAGE_RIGHT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color", STRING, SELECTION_HIGHLIGHT_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box", RECTANGLE, DECORATION_BOUNDING_BOX ) DALI_TYPE_REGISTRATION_END() @@ -186,7 +197,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr { float pointSize = value.Get< float >(); - if( impl.mController->GetDefaultPointSize() != pointSize /*TODO - epsilon*/ ) + if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) ) { impl.mController->SetDefaultPointSize( pointSize ); impl.RequestTextRelayout(); @@ -199,6 +210,73 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr impl.mExceedPolicy = value.Get< int >(); break; } + case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT: + { + LayoutEngine& engine = impl.mController->GetLayoutEngine(); + const LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::HorizontalAlignment >( value.Get< std::string >().c_str(), + HORIZONTAL_ALIGNMENT_STRING_TABLE, + HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ); + + if( engine.GetHorizontalAlignment() != alignment ) + { + engine.SetHorizontalAlignment( alignment ); + impl.RequestTextRelayout(); + } + break; + } + case Toolkit::TextField::Property::VERTICAL_ALIGNMENT: + { + LayoutEngine& engine = impl.mController->GetLayoutEngine(); + const LayoutEngine::VerticalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::VerticalAlignment >( value.Get< std::string >().c_str(), + VERTICAL_ALIGNMENT_STRING_TABLE, + VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ); + + if( engine.GetVerticalAlignment() != alignment ) + { + engine.SetVerticalAlignment( alignment ); + impl.RequestTextRelayout(); + } + break; + } + case Toolkit::TextField::Property::TEXT_COLOR: + { + if ( impl.mController ) + { + Vector4 textColor = value.Get< Vector4 >(); + if ( impl.mController->GetTextColor() != textColor ) + { + impl.mController->SetTextColor( textColor ); + impl.RequestTextRelayout(); + } + } + break; + } + case Toolkit::TextField::Property::SHADOW_OFFSET: + { + if( impl.mController ) + { + Vector2 shadowOffset = value.Get< Vector2 >(); + if ( impl.mController->GetShadowOffset() != shadowOffset ) + { + impl.mController->SetShadowOffset( shadowOffset ); + impl.RequestTextRelayout(); + } + } + break; + } + case Toolkit::TextField::Property::SHADOW_COLOR: + { + if( impl.mController ) + { + Vector4 shadowColor = value.Get< Vector4 >(); + if ( impl.mController->GetShadowColor() != shadowColor ) + { + impl.mController->SetShadowColor( shadowColor ); + impl.RequestTextRelayout(); + } + } + break; + } case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR: { if( impl.mDecorator ) @@ -245,43 +323,95 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr if( impl.mDecorator ) { - impl.mDecorator->SetGrabHandleImage( image ); + impl.mDecorator->SetGrabHandleImage( GRAB_HANDLE_IMAGE_RELEASED, image ); } break; } - case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX: + case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE: { + ResourceImage image = ResourceImage::New( value.Get< std::string >() ); + if( impl.mDecorator ) { - impl.mDecorator->SetBoundingBox( value.Get< Rect >() ); + impl.mDecorator->SetGrabHandleImage( GRAB_HANDLE_IMAGE_PRESSED, image ); } break; } - case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT: + case Toolkit::TextField::Property::SCROLL_THRESHOLD: { - LayoutEngine& engine = impl.mController->GetLayoutEngine(); - const LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::HorizontalAlignment >( value.Get< std::string >().c_str(), - HORIZONTAL_ALIGNMENT_STRING_TABLE, - HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ); + float threshold = value.Get< float >(); - if( engine.GetHorizontalAlignment() != alignment ) + if( impl.mDecorator ) { - engine.SetHorizontalAlignment( alignment ); - impl.RequestTextRelayout(); + impl.mDecorator->SetScrollThreshold( threshold ); } break; } - case Toolkit::TextField::Property::VERTICAL_ALIGNMENT: + case Toolkit::TextField::Property::SCROLL_SPEED: { - LayoutEngine& engine = impl.mController->GetLayoutEngine(); - const LayoutEngine::VerticalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::VerticalAlignment >( value.Get< std::string >().c_str(), - VERTICAL_ALIGNMENT_STRING_TABLE, - VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ); + float speed = value.Get< float >(); - if( engine.GetVerticalAlignment() != alignment ) + if( impl.mDecorator ) { - engine.SetVerticalAlignment( alignment ); - impl.RequestTextRelayout(); + impl.mDecorator->SetScrollSpeed( speed ); + } + break; + } + case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT: + { + ResourceImage image = ResourceImage::New( value.Get< std::string >() ); + + if( impl.mDecorator ) + { + impl.mDecorator->SetLeftSelectionImage( SELECTION_HANDLE_RELEASED, image ); + } + break; + } + case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT: + { + ResourceImage image = ResourceImage::New( value.Get< std::string >() ); + + if( impl.mDecorator ) + { + impl.mDecorator->SetRightSelectionImage( SELECTION_HANDLE_RELEASED, image ); + } + break; + } + case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT: + { + ResourceImage image = ResourceImage::New( value.Get< std::string >() ); + + if( impl.mDecorator ) + { + impl.mDecorator->SetLeftSelectionImage( SELECTION_HANDLE_PRESSED, image ); + } + break; + } + case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT: + { + ResourceImage image = ResourceImage::New( value.Get< std::string >() ); + + if( impl.mDecorator ) + { + impl.mDecorator->SetLeftSelectionImage( SELECTION_HANDLE_PRESSED, image ); + } + break; + } + case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR: + { + Vector4 color = value.Get< Vector4 >(); + + if( impl.mDecorator ) + { + impl.mDecorator->SetHighlightColor( color ); + } + break; + } + case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX: + { + if( impl.mDecorator ) + { + impl.mDecorator->SetBoundingBox( value.Get< Rect >() ); } break; } @@ -331,6 +461,50 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde value = impl.mExceedPolicy; break; } + case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT: + { + if( impl.mController ) + { + value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::HorizontalAlignment >( impl.mController->GetLayoutEngine().GetHorizontalAlignment(), + HORIZONTAL_ALIGNMENT_STRING_TABLE, + HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ) ); + } + break; + } + case Toolkit::TextField::Property::VERTICAL_ALIGNMENT: + { + if( impl.mController ) + { + value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::VerticalAlignment >( impl.mController->GetLayoutEngine().GetVerticalAlignment(), + VERTICAL_ALIGNMENT_STRING_TABLE, + VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ) ); + } + break; + } + case Toolkit::TextField::Property::TEXT_COLOR: + { + if ( impl.mController ) + { + value = impl.mController->GetTextColor(); + } + break; + } + case Toolkit::TextField::Property::SHADOW_OFFSET: + { + if ( impl.mController ) + { + value = impl.mController->GetShadowOffset(); + } + break; + } + case Toolkit::TextField::Property::SHADOW_COLOR: + { + if ( impl.mController ) + { + value = impl.mController->GetShadowColor(); + } + break; + } case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR: { if( impl.mDecorator ) @@ -368,31 +542,107 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde } break; } - case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX: + case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE: { if( impl.mDecorator ) { - value = impl.mDecorator->GetBoundingBox(); + ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetGrabHandleImage( GRAB_HANDLE_IMAGE_RELEASED ) ); + if( image ) + { + value = image.GetUrl(); + } } break; } - case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT: + case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE: { - if( impl.mController ) + if( impl.mDecorator ) { - value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::HorizontalAlignment >( impl.mController->GetLayoutEngine().GetHorizontalAlignment(), - HORIZONTAL_ALIGNMENT_STRING_TABLE, - HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ) ); + ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetGrabHandleImage( GRAB_HANDLE_IMAGE_PRESSED ) ); + if( image ) + { + value = image.GetUrl(); + } } break; } - case Toolkit::TextField::Property::VERTICAL_ALIGNMENT: + case Toolkit::TextField::Property::SCROLL_THRESHOLD: { - if( impl.mController ) + if( impl.mDecorator ) { - value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::VerticalAlignment >( impl.mController->GetLayoutEngine().GetVerticalAlignment(), - VERTICAL_ALIGNMENT_STRING_TABLE, - VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ) ); + value = impl.mDecorator->GetScrollThreshold(); + } + break; + } + case Toolkit::TextField::Property::SCROLL_SPEED: + { + if( impl.mDecorator ) + { + value = impl.mDecorator->GetScrollSpeed(); + } + break; + } + case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT: + { + if( impl.mDecorator ) + { + ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetLeftSelectionImage( SELECTION_HANDLE_RELEASED ) ); + if( image ) + { + value = image.GetUrl(); + } + } + break; + } + case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT: + { + if( impl.mDecorator ) + { + ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetRightSelectionImage( SELECTION_HANDLE_RELEASED ) ); + if( image ) + { + value = image.GetUrl(); + } + } + break; + } + case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT: + { + if( impl.mDecorator ) + { + ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetLeftSelectionImage( SELECTION_HANDLE_PRESSED ) ); + if( image ) + { + value = image.GetUrl(); + } + } + break; + } + case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT: + { + if( impl.mDecorator ) + { + ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetRightSelectionImage( SELECTION_HANDLE_PRESSED ) ); + if( image ) + { + value = image.GetUrl(); + } + } + break; + } + case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR: + { + if( impl.mDecorator ) + { + value = impl.mDecorator->GetHighlightColor(); + } + break; + } + case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX: + { + if( impl.mDecorator ) + { + value = impl.mDecorator->GetBoundingBox(); } break; } diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index f247c61..44bd0ae 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -173,7 +173,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr { float pointSize = value.Get< float >(); - if( fabsf(impl.mController->GetDefaultPointSize() - pointSize) > Math::MACHINE_EPSILON_1 ) + if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) ) { impl.mController->SetDefaultPointSize( pointSize ); impl.RequestTextRelayout(); diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index 2098a5f..6d348cb 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -72,7 +72,8 @@ Integration::Log::Filter* gLogFilter( Integration::Log::Filter::New(Debug::NoLog namespace { -const char* DEFAULT_GRAB_HANDLE_IMAGE( DALI_IMAGE_DIR "insertpoint-icon.png" ); +const char* DEFAULT_GRAB_HANDLE_IMAGE_RELEASED( DALI_IMAGE_DIR "insertpoint-icon.png" ); +const char* DEFAULT_GRAB_HANDLE_IMAGE_PRESSED( DALI_IMAGE_DIR "insertpoint-icon-pressed.png" ); const char* DEFAULT_SELECTION_HANDLE_ONE( DALI_IMAGE_DIR "text-input-selection-handle-left.png" ); const char* DEFAULT_SELECTION_HANDLE_TWO( DALI_IMAGE_DIR "text-input-selection-handle-right.png" ); //const char* DEFAULT_SELECTION_HANDLE_ONE_PRESSED( DALI_IMAGE_DIR "text-input-selection-handle-left-press.png" ); @@ -87,10 +88,12 @@ const float TO_SECONDS = 1.f / TO_MILLISECONDS; const float DISPLAYED_HIGHLIGHT_Z_OFFSET( -0.05f ); -const float SCROLL_THRESHOLD = 10.f; -const float SCROLL_SPEED = 15.f; const unsigned int SCROLL_TICK_INTERVAL = 50u; +const float SCROLL_THRESHOLD = 10.f; +const float SCROLL_SPEED = 300.f; +const float SCROLL_DISTANCE = SCROLL_SPEED * SCROLL_TICK_INTERVAL * TO_SECONDS; + /** * structure to hold coordinates of each quad, which will make up the mesh. */ @@ -192,9 +195,6 @@ struct Decorator::Impl : public ConnectionTracker ImageActor actor; Actor grabArea; - Image pressedImage; - Image releasedImage; - Vector2 position; float lineHeight; ///< Not the handle height bool flipped; @@ -213,7 +213,7 @@ struct Decorator::Impl : public ConnectionTracker mScrollDirection( SCROLL_NONE ), mScrollThreshold( SCROLL_THRESHOLD ), mScrollSpeed( SCROLL_SPEED ), - mScrollInterval( SCROLL_TICK_INTERVAL ), + mScrollDistance( SCROLL_DISTANCE ), mActiveGrabHandle( false ), mActiveSelection( false ), mActiveCopyPastePopup( false ), @@ -352,9 +352,9 @@ struct Decorator::Impl : public ConnectionTracker mCopyPastePopup.SetPosition( popupPosition ); //todo grabhandle(cursor) or selection handle positions to be used } - void CreateCursor( ImageActor& cursor ) + void CreateCursor( ImageActor& cursor, const Vector4& color ) { - cursor = CreateSolidColorActor( Color::WHITE ); + cursor = CreateSolidColorActor( color ); cursor.SetParentOrigin( ParentOrigin::TOP_LEFT ); // Need to set the default parent origin as CreateSolidColorActor() sets a different one. cursor.SetAnchorPoint( AnchorPoint::TOP_CENTER ); } @@ -375,7 +375,7 @@ struct Decorator::Impl : public ConnectionTracker { if ( !mPrimaryCursor ) { - CreateCursor( mPrimaryCursor ); + CreateCursor( mPrimaryCursor, mCursor[PRIMARY_CURSOR].color ); #ifdef DECORATOR_DEBUG mPrimaryCursor.SetName( "PrimaryCursorActor" ); #endif @@ -387,7 +387,7 @@ struct Decorator::Impl : public ConnectionTracker { if ( !mSecondaryCursor ) { - CreateCursor( mSecondaryCursor ); + CreateCursor( mSecondaryCursor, mCursor[SECONDARY_CURSOR].color ); #ifdef DECORATOR_DEBUG mSecondaryCursor.SetName( "SecondaryCursorActor" ); #endif @@ -458,12 +458,16 @@ struct Decorator::Impl : public ConnectionTracker { if( !mGrabHandle ) { - if ( !mGrabHandleImage ) + if ( !mGrabHandleImageReleased ) { - mGrabHandleImage = ResourceImage::New( DEFAULT_GRAB_HANDLE_IMAGE ); + mGrabHandleImageReleased = ResourceImage::New( DEFAULT_GRAB_HANDLE_IMAGE_RELEASED ); + } + if ( !mGrabHandleImagePressed ) + { + mGrabHandleImagePressed = ResourceImage::New( DEFAULT_GRAB_HANDLE_IMAGE_PRESSED ); } - mGrabHandle = ImageActor::New( mGrabHandleImage ); + mGrabHandle = ImageActor::New( mGrabHandleImageReleased ); mGrabHandle.SetAnchorPoint( AnchorPoint::TOP_CENTER ); mGrabHandle.SetDrawMode( DrawMode::OVERLAY ); // Area that Grab handle responds to, larger than actual handle so easier to move @@ -501,12 +505,12 @@ struct Decorator::Impl : public ConnectionTracker SelectionHandleImpl& primary = mSelectionHandle[ PRIMARY_SELECTION_HANDLE ]; if ( !primary.actor ) { - if ( !primary.releasedImage ) + if ( !mSelectionReleasedLeft ) { - primary.releasedImage = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE ); + mSelectionReleasedLeft = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE ); } - primary.actor = ImageActor::New( primary.releasedImage ); + primary.actor = ImageActor::New( mSelectionReleasedLeft ); #ifdef DECORATOR_DEBUG primary.actor.SetName("SelectionHandleOne"); #endif @@ -533,12 +537,12 @@ struct Decorator::Impl : public ConnectionTracker SelectionHandleImpl& secondary = mSelectionHandle[ SECONDARY_SELECTION_HANDLE ]; if ( !secondary.actor ) { - if ( !secondary.releasedImage ) + if ( !mSelectionReleasedRight ) { - secondary.releasedImage = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO ); + mSelectionReleasedRight = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO ); } - secondary.actor = ImageActor::New( secondary.releasedImage ); + secondary.actor = ImageActor::New( mSelectionReleasedRight ); #ifdef DECORATOR_DEBUG secondary.actor.SetName("SelectionHandleTwo"); #endif @@ -696,6 +700,7 @@ struct Decorator::Impl : public ConnectionTracker if( Gesture::Started == gesture.state ) { mGrabDisplacementX = mGrabDisplacementY = 0; + mGrabHandle.SetImage( mGrabHandleImagePressed ); } mGrabDisplacementX += gesture.displacement.x; @@ -739,6 +744,8 @@ struct Decorator::Impl : public ConnectionTracker { mObserver.GrabHandleEvent( GRAB_HANDLE_RELEASED, x, y ); } + + mGrabHandle.SetImage( mGrabHandleImageReleased ); } } } @@ -866,6 +873,7 @@ struct Decorator::Impl : public ConnectionTracker void SetScrollSpeed( float speed ) { mScrollSpeed = speed; + mScrollDistance = speed * SCROLL_TICK_INTERVAL * TO_SECONDS; } float GetScrollSpeed() const @@ -873,16 +881,6 @@ struct Decorator::Impl : public ConnectionTracker return mScrollSpeed; } - void SetScrollTickInterval( float seconds ) - { - mScrollInterval = static_cast( seconds * TO_MILLISECONDS ); - } - - float GetScrollTickInterval() const - { - return static_cast( mScrollInterval ) * TO_SECONDS; - } - /** * Creates and starts a timer to scroll the text when handles are close to the edges of the text. * @@ -892,7 +890,7 @@ struct Decorator::Impl : public ConnectionTracker { if( !mScrollTimer ) { - mScrollTimer = Timer::New( mScrollInterval ); + mScrollTimer = Timer::New( SCROLL_TICK_INTERVAL ); mScrollTimer.TickSignal().Connect( this, &Decorator::Impl::OnScrollTimerTick ); } @@ -921,7 +919,7 @@ struct Decorator::Impl : public ConnectionTracker bool OnScrollTimerTick() { mObserver.GrabHandleEvent( GRAB_HANDLE_SCROLLING, - mScrollDirection == SCROLL_RIGHT ? mScrollSpeed : -mScrollSpeed, + mScrollDirection == SCROLL_RIGHT ? mScrollDistance : -mScrollDistance, 0.f ); return true; } @@ -943,15 +941,22 @@ struct Decorator::Impl : public ConnectionTracker TextSelectionPopup mCopyPastePopup; Image mCursorImage; - Image mGrabHandleImage; + Image mGrabHandleImageReleased; + Image mGrabHandleImagePressed; Mesh mHighlightMesh; ///< Mesh for highlight MeshData mHighlightMeshData; ///< Mesh Data for highlight Material mHighlightMaterial; ///< Material used for highlight CursorImpl mCursor[CURSOR_COUNT]; SelectionHandleImpl mSelectionHandle[SELECTION_HANDLE_COUNT]; + QuadContainer mHighlightQuadList; ///< Sub-selections that combine to create the complete selection highlight + Image mSelectionReleasedLeft; ///< Selection handle images + Image mSelectionReleasedRight; + Image mSelectionPressedLeft; + Image mSelectionPressedRight; + Rect mBoundingBox; Vector4 mHighlightColor; ///< Color of the highlight @@ -962,7 +967,8 @@ struct Decorator::Impl : public ConnectionTracker float mGrabDisplacementY; ScrollDirection mScrollDirection; ///< The direction of the scroll. float mScrollThreshold; ///< Defines a square area inside the control, close to the edge. A cursor entering this area will trigger scroll events. - float mScrollSpeed; ///< Distance the text scrolls during a scroll interval. + float mScrollSpeed; ///< The scroll speed in pixels per second. + float mScrollDistance; ///< Distance the text scrolls during a scroll interval. unsigned int mScrollInterval; ///< Time in milliseconds of a scroll interval. bool mActiveGrabHandle : 1; @@ -1102,14 +1108,26 @@ bool Decorator::IsGrabHandleActive() const return mImpl->mActiveGrabHandle; } -void Decorator::SetGrabHandleImage( Dali::Image image ) +void Decorator::SetGrabHandleImage( GrabHandleImageType type, Dali::Image image ) { - mImpl->mGrabHandleImage = image; + if( GRAB_HANDLE_IMAGE_PRESSED == type ) + { + mImpl->mGrabHandleImagePressed = image; + } + else + { + mImpl->mGrabHandleImageReleased = image; + } } -Dali::Image Decorator::GetGrabHandleImage() const +Dali::Image Decorator::GetGrabHandleImage( GrabHandleImageType type ) const { - return mImpl->mGrabHandleImage; + if( GRAB_HANDLE_IMAGE_PRESSED == type ) + { + return mImpl->mGrabHandleImagePressed; + } + + return mImpl->mGrabHandleImageReleased; } /** Selection **/ @@ -1138,26 +1156,48 @@ void Decorator::GetPosition( SelectionHandle handle, float& x, float& y, float& height = mImpl->mSelectionHandle[handle].lineHeight; } -void Decorator::SetImage( SelectionHandle handle, SelectionHandleState state, Dali::Image image ) +void Decorator::SetLeftSelectionImage( SelectionHandleState state, Dali::Image image ) { if( SELECTION_HANDLE_PRESSED == state ) { - mImpl->mSelectionHandle[handle].pressedImage = image; + mImpl->mSelectionPressedLeft = image; } else { - mImpl->mSelectionHandle[handle].releasedImage = image; + mImpl->mSelectionReleasedLeft = image; } } -Dali::Image Decorator::GetImage( SelectionHandle handle, SelectionHandleState state ) const +Dali::Image Decorator::GetLeftSelectionImage( SelectionHandleState state ) const { if( SELECTION_HANDLE_PRESSED == state ) { - return mImpl->mSelectionHandle[handle].pressedImage; + return mImpl->mSelectionPressedLeft; } - return mImpl->mSelectionHandle[handle].releasedImage; + return mImpl->mSelectionReleasedLeft; +} + +void Decorator::SetRightSelectionImage( SelectionHandleState state, Dali::Image image ) +{ + if( SELECTION_HANDLE_PRESSED == state ) + { + mImpl->mSelectionPressedRight = image; + } + else + { + mImpl->mSelectionReleasedRight = image; + } +} + +Dali::Image Decorator::GetRightSelectionImage( SelectionHandleState state ) const +{ + if( SELECTION_HANDLE_PRESSED == state ) + { + return mImpl->mSelectionPressedRight; + } + + return mImpl->mSelectionReleasedRight; } void Decorator::AddHighlight( float x1, float y1, float x2, float y2 ) @@ -1170,6 +1210,16 @@ void Decorator::ClearHighlights() mImpl->mHighlightQuadList.clear(); } +void Decorator::SetHighlightColor( const Vector4& color ) +{ + mImpl->mHighlightColor = color; +} + +const Vector4& Decorator::GetHighlightColor() const +{ + return mImpl->mHighlightColor; +} + void Decorator::SetPopupActive( bool active ) { mImpl->mActiveCopyPastePopup = active; @@ -1202,16 +1252,6 @@ float Decorator::GetScrollSpeed() const return mImpl->GetScrollSpeed(); } -void Decorator::SetScrollTickInterval( float seconds ) -{ - mImpl->SetScrollTickInterval( seconds ); -} - -float Decorator::GetScrollTickInterval() const -{ - return mImpl->GetScrollTickInterval(); -} - Decorator::~Decorator() { delete mImpl; diff --git a/dali-toolkit/internal/text/decorator/text-decorator.h b/dali-toolkit/internal/text/decorator/text-decorator.h index 588d224..e8bc5cf 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.h +++ b/dali-toolkit/internal/text/decorator/text-decorator.h @@ -71,6 +71,13 @@ enum GrabHandleState GRAB_HANDLE_STOP_SCROLLING }; +// Used to set different grab handle images +enum GrabHandleImageType +{ + GRAB_HANDLE_IMAGE_PRESSED, + GRAB_HANDLE_IMAGE_RELEASED +}; + // The set the selection-handle positions etc. enum SelectionHandle { @@ -297,16 +304,18 @@ public: /** * @brief Sets the image for the grab handle. * + * @param[in] type A different image can be set for the pressed/released states. * @param[in] image The image to use. */ - void SetGrabHandleImage( Dali::Image image ); + void SetGrabHandleImage( GrabHandleImageType type, Dali::Image image ); /** * @brief Retrieves the image for the grab handle. * + * @param[in] type A different image can be set for the pressed/released states. * @return The grab handle image. */ - Dali::Image GetGrabHandleImage() const; + Dali::Image GetGrabHandleImage( GrabHandleImageType type ) const; /** * @brief Sets whether the selection handles and highlight are active. @@ -345,20 +354,34 @@ public: /** * @brief Sets the image for one of the selection handles. * - * @param[in] handle The selection handle. * @param[in] state A different image can be set for the pressed/released states. * @param[in] image The image to use. */ - void SetImage( SelectionHandle handle, SelectionHandleState state, Dali::Image image ); + void SetLeftSelectionImage( SelectionHandleState state, Dali::Image image ); /** * @brief Retrieves the image for a selection handle. * - * @param[in] handle The selection handle. * @param[in] state A different image can be set for the pressed/released states. * @return The image. */ - Dali::Image GetImage( SelectionHandle handle, SelectionHandleState state ) const; + Dali::Image GetLeftSelectionImage( SelectionHandleState state ) const; + + /** + * @brief Sets the image for one of the selection handles. + * + * @param[in] state A different image can be set for the pressed/released states. + * @param[in] image The image to use. + */ + void SetRightSelectionImage( SelectionHandleState state, Dali::Image image ); + + /** + * @brief Retrieves the image for a selection handle. + * + * @param[in] state A different image can be set for the pressed/released states. + * @return The image. + */ + Dali::Image GetRightSelectionImage( SelectionHandleState state ) const; /** * @brief Adds a quad to the existing selection highlights. @@ -376,6 +399,20 @@ public: void ClearHighlights(); /** + * @brief Sets the selection highlight color. + * + * @param[in] image The image to use. + */ + void SetHighlightColor( const Vector4& color ); + + /** + * @brief Retrieves the selection highlight color. + * + * @return The image. + */ + const Vector4& GetHighlightColor() const; + + /** * @brief Set the Selection Popup to show or hide via the active flaf * @param[in] active true to show, false to hide */ diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 74d9abf..6baf19e 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -105,8 +105,8 @@ EventData::EventData( DecoratorPtr decorator ) mDecoratorUpdated( false ), mCursorBlinkEnabled( true ), mGrabHandleEnabled( true ), - mGrabHandlePopupEnabled( true ), - mSelectionEnabled( true ), + mGrabHandlePopupEnabled( false ), + mSelectionEnabled( false ), mHorizontalScrollingEnabled( true ), mVerticalScrollingEnabled( false ), mUpdateCursorPosition( false ), diff --git a/dali-toolkit/public-api/controls/text-controls/text-field.h b/dali-toolkit/public-api/controls/text-controls/text-field.h index 3736a2f..8eac8f7 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-field.h +++ b/dali-toolkit/public-api/controls/text-controls/text-field.h @@ -55,22 +55,33 @@ public: { enum { - RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based, type INT - PLACEHOLDER_TEXT, ///< name "placeholder-text", The text to display when the TextField is empty, type STRING - TEXT, ///< name "text", The text to display in UTF-8 format, type STRING - FONT_FAMILY, ///< name "font-family", The requested font family, type STRING - FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING - POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT - EXCEED_POLICY, ///< name "exceed-policy" Specifies how the text is truncated when it does not fit, type INT - PRIMARY_CURSOR_COLOR, ///< name "primary-cursor-color", The color to apply to the primary cursor, type VECTOR4 - SECONDARY_CURSOR_COLOR, ///< name "secondary-cursor-color", The color to apply to the secondary cursor, type VECTOR4 - ENABLE_CURSOR_BLINK, ///< name "enable-cursor-blink", Whether the cursor should blink or not, type BOOLEAN - CURSOR_BLINK_INTERVAL, ///< name "cursor-blink-interval", The time interval between cursor on/off states, type FLOAT - CURSOR_BLINK_DURATION, ///< name "cursor-blink-duration", The cursor will stop blinking after this duration (if non-zero), type FLOAT - GRAB_HANDLE_IMAGE, ///< name "grab-handle-image", The image to display for grab handle, type STRING - DECORATION_BOUNDING_BOX, ///< name "decoration-bounding-box", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE - HORIZONTAL_ALIGNMENT, ///< name "horizontal-alignment", The line horizontal alignment, type STRING, values "BEGIN", "CENTER", "END" - VERTICAL_ALIGNMENT ///< name "vertical-alignment", The line vertical alignment, type STRING, values "TOP", "CENTER", "BOTTOM" + RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based, type INT + PLACEHOLDER_TEXT, ///< name "placeholder-text", The text to display when the TextField is empty, type STRING + TEXT, ///< name "text", The text to display in UTF-8 format, type STRING + FONT_FAMILY, ///< name "font-family", The requested font family, type STRING + FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING + POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT + EXCEED_POLICY, ///< name "exceed-policy" Specifies how the text is truncated when it does not fit, type INT + HORIZONTAL_ALIGNMENT, ///< name "horizontal-alignment", The line horizontal alignment, type STRING, values "BEGIN", "CENTER", "END" + VERTICAL_ALIGNMENT, ///< name "vertical-alignment", The line vertical alignment, type STRING, values "TOP", "CENTER", "BOTTOM" + TEXT_COLOR, ///< name "text-color", The text color, type VECTOR4 + SHADOW_OFFSET, ///< name "shadow-offset", The drop shadow offset 0 indicates no shadow, type VECTOR2 + SHADOW_COLOR, ///< name "shadow-color", The color of a drop shadow, type VECTOR4 + PRIMARY_CURSOR_COLOR, ///< name "primary-cursor-color", The color to apply to the primary cursor, type VECTOR4 + SECONDARY_CURSOR_COLOR, ///< name "secondary-cursor-color", The color to apply to the secondary cursor, type VECTOR4 + ENABLE_CURSOR_BLINK, ///< name "enable-cursor-blink", Whether the cursor should blink or not, type BOOLEAN + CURSOR_BLINK_INTERVAL, ///< name "cursor-blink-interval", The time interval in seconds between cursor on/off states, type FLOAT + CURSOR_BLINK_DURATION, ///< name "cursor-blink-duration", The cursor will stop blinking after this number of seconds (if non-zero), type FLOAT + GRAB_HANDLE_IMAGE, ///< name "grab-handle-image", The image to display for the grab handle, type STRING + GRAB_HANDLE_PRESSED_IMAGE, ///< name "grab-handle-pressed-image", The image to display when the grab handle is pressed, type STRING + SCROLL_THRESHOLD, ///< name "scroll-threshold" Scrolling will occur if the cursor is this close to the control border, type FLOAT + SCROLL_SPEED, ///< name "scroll-speed" The scroll speed in pixels per second, type FLOAT + SELECTION_HANDLE_IMAGE_LEFT, ///< name "selection-handle-image-left", The image to display for the left selection handle, type STRING + SELECTION_HANDLE_IMAGE_RIGHT, ///< name "selection-handle-image-right", The image to display for the right selection handle, type STRING + SELECTION_HANDLE_PRESSED_IMAGE_LEFT, ///< name "selection-handle-pressed-image-left" The image to display when the left selection handle is pressed, type STRING + SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, ///< name "selection-handle-pressed-image-right" The image to display when the right selection handle is pressed, type STRING + SELECTION_HIGHLIGHT_COLOR, ///< name "selection-highlight-color" The color of the selection highlight, type VECTOR4 + DECORATION_BOUNDING_BOX ///< name "decoration-bounding-box", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE }; }; -- 2.7.4