Merge "Add read-only property for getting text line count" into devel/master
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 2 Jun 2017 04:37:37 +0000 (04:37 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 2 Jun 2017 04:37:37 +0000 (04:37 +0000)
1  2 
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp

@@@ -117,7 -117,8 +117,8 @@@ DALI_PROPERTY_REGISTRATION( Toolkit, Te
  DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pixelSize",           FLOAT,   PIXEL_SIZE             )
  DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "ellipsis",            BOOLEAN, ELLIPSIS               )
  DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopDelay", FLOAT,   AUTO_SCROLL_LOOP_DELAY )
- DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollStopMode",  STRING,  AUTO_SCROLL_STOP_MODE )
+ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollStopMode",  STRING,  AUTO_SCROLL_STOP_MODE  )
+ DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "lineCount", INTEGER, LINE_COUNT             )
  
  DALI_TYPE_REGISTRATION_END()
  
@@@ -349,7 -350,7 +350,7 @@@ void TextLabel::SetProperty( BaseObject
               {
                 if( impl.mTextScroller )
                 {
 -                 impl.mTextScroller->SetLoopCount( 0 ); // Causes the current animation to finish playing (0)
 +                 impl.mTextScroller->StopScrolling();
                 }
               }
               // If request is enable (true) then start autoscroll as not already running
@@@ -736,6 -737,15 +737,15 @@@ Property::Value TextLabel::GetProperty
          }
          break;
        }
+       case Toolkit::DevelTextLabel::Property::LINE_COUNT:
+       {
+         if( impl.mController )
+         {
+           float width = label.GetProperty( Actor::Property::SIZE_WIDTH ).Get<float>();
+           value = impl.mController->GetLineCount( width );
+         }
+         break;
+       }
      }
    }
  
@@@ -881,7 -891,7 +891,7 @@@ void TextLabel::SetUpAutoScrolling(
      // If speed, loopCount or gap not set via property system then will need to create a TextScroller with defaults
      mTextScroller = Text::TextScroller::New( *this );
    }
 -  mTextScroller->SetParameters( mRenderableActor, controlSize, offScreenSize, direction, alignmentOffset );
 +  mTextScroller->SetParameters( mRenderableActor, controlSize, offScreenSize, direction, alignmentOffset, mController->GetHorizontalAlignment() );
  
    Actor self = Self();
    self.Add( mTextScroller->GetScrollingText() );