projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Selection implementation.
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
text-controller.cpp
diff --git
a/dali-toolkit/internal/text/text-controller.cpp
b/dali-toolkit/internal/text/text-controller.cpp
index
589a018
..
3b36ed3
100644
(file)
--- a/
dali-toolkit/internal/text/text-controller.cpp
+++ b/
dali-toolkit/internal/text/text-controller.cpp
@@
-337,8
+337,7
@@
bool Controller::RemoveText( int cursorOffset, int numberOfChars )
numberOfChars = currentText.Count() - cursorIndex;
}
numberOfChars = currentText.Count() - cursorIndex;
}
- if( cursorIndex >= 0 &&
- (cursorIndex + numberOfChars) <= currentText.Count() )
+ if( (cursorIndex + numberOfChars) <= currentText.Count() )
{
Vector<Character>::Iterator first = currentText.Begin() + cursorIndex;
Vector<Character>::Iterator last = first + numberOfChars;
{
Vector<Character>::Iterator first = currentText.Begin() + cursorIndex;
Vector<Character>::Iterator last = first + numberOfChars;
@@
-709,7
+708,7
@@
void Controller::ResetScrollPosition()
{
// Reset the scroll position.
mImpl->mEventData->mScrollPosition = Vector2::ZERO;
{
// Reset the scroll position.
mImpl->mEventData->mScrollPosition = Vector2::ZERO;
- mImpl->mEventData->mScrollAfterUpdate
Cursor
Position = true;
+ mImpl->mEventData->mScrollAfterUpdatePosition = true;
}
}
}
}
@@
-750,7
+749,7
@@
void Controller::TextInsertedEvent()
// Queue a cursor reposition event; this must wait until after DoRelayout()
mImpl->mEventData->mUpdateCursorPosition = true;
// Queue a cursor reposition event; this must wait until after DoRelayout()
mImpl->mEventData->mUpdateCursorPosition = true;
- mImpl->mEventData->mScrollAfterUpdate
Cursor
Position = true;
+ mImpl->mEventData->mScrollAfterUpdatePosition = true;
}
void Controller::TextDeletedEvent()
}
void Controller::TextDeletedEvent()
@@
-1143,14
+1142,15
@@
bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
if( removed )
{
if( removed )
{
- if( 0u == mImpl->mLogicalModel->mText.Count() )
+ if( 0u != mImpl->mLogicalModel->mText.Count() ||
+ !mImpl->IsPlaceholderAvailable() )
{
{
- ShowPlaceholderText();
- mImpl->mEventData->mUpdateCursorPosition = true;
+ mImpl->QueueModifyEvent( ModifyEvent::TEXT_DELETED );
}
else
{
}
else
{
- mImpl->QueueModifyEvent( ModifyEvent::TEXT_DELETED );
+ ShowPlaceholderText();
+ mImpl->mEventData->mUpdateCursorPosition = true;
}
textChanged = true;
}
textChanged = true;
@@
-1305,12
+1305,12
@@
void Controller::TapEvent( unsigned int tapCount, float x, float y )
if( NULL != mImpl->mEventData )
{
if( NULL != mImpl->mEventData )
{
+ const bool isShowingPlaceholderText = mImpl->IsShowingPlaceholderText();
if( 1u == tapCount )
{
bool tapDuringEditMode( EventData::EDITING == mImpl->mEventData->mState );
if( 1u == tapCount )
{
bool tapDuringEditMode( EventData::EDITING == mImpl->mEventData->mState );
- if( ! mImpl->IsShowingPlaceholderText() &&
- EventData::EDITING == mImpl->mEventData->mState )
+ if( !isShowingPlaceholderText && tapDuringEditMode )
{
// Grab handle is not shown until a tap is received whilst EDITING
if( tapDuringEditMode )
{
// Grab handle is not shown until a tap is received whilst EDITING
if( tapDuringEditMode )
@@
-1322,7
+1322,8
@@
void Controller::TapEvent( unsigned int tapCount, float x, float y )
mImpl->ChangeState( EventData::EDITING );
}
mImpl->ChangeState( EventData::EDITING );
}
- else if( mImpl->mEventData->mSelectionEnabled &&
+ else if( !isShowingPlaceholderText &&
+ mImpl->mEventData->mSelectionEnabled &&
( 2u == tapCount ) )
{
mImpl->ChangeState( EventData::SELECTING );
( 2u == tapCount ) )
{
mImpl->ChangeState( EventData::SELECTING );
@@
-1366,9
+1367,9
@@
void Controller::GetTargetSize( Vector2& targetSize )
targetSize = mImpl->mControlSize;
}
targetSize = mImpl->mControlSize;
}
-void Controller::AddDecoration( Actor& actor )
+void Controller::AddDecoration( Actor& actor
, bool needsClipping
)
{
{
- mImpl->mControlInterface.AddDecoration( actor );
+ mImpl->mControlInterface.AddDecoration( actor
, needsClipping
);
}
void Controller::DecorationEvent( HandleType handleType, HandleState state, float x, float y )
}
void Controller::DecorationEvent( HandleType handleType, HandleState state, float x, float y )