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
Merge "Fix the child position when Parent sets Padding" into devel/master
[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
0ada75e
..
1745686
100755
(executable)
--- a/
dali-toolkit/internal/text/text-controller.cpp
+++ b/
dali-toolkit/internal/text/text-controller.cpp
@@
-25,6
+25,7
@@
#include <dali/integration-api/debug.h>
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/integration-api/debug.h>
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/devel-api/adaptor-framework/key-devel.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-controls/placeholder-properties.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-controls/placeholder-properties.h>
@@
-346,6
+347,7
@@
void Controller::SetMultiLineEnabled( bool enable )
ALIGN |
REORDER );
ALIGN |
REORDER );
+ mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true;
mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending | layoutOperations );
mImpl->RequestRelayout();
mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending | layoutOperations );
mImpl->RequestRelayout();
@@
-2330,7
+2332,7
@@
bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
// Do nothing.
return false;
}
// Do nothing.
return false;
}
- else if( Dali::DALI_KEY_ESCAPE == keyCode || Dali::DALI_KEY_BACK == keyCode )
+ else if( Dali::DALI_KEY_ESCAPE == keyCode || Dali::DALI_KEY_BACK == keyCode
|| Dali::DALI_KEY_SEARCH == keyCode
)
{
// Do nothing
return false;
{
// Do nothing
return false;
@@
-2370,9
+2372,10
@@
bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
// Will request for relayout.
relayoutNeeded = true;
}
// Will request for relayout.
relayoutNeeded = true;
}
- else if( Dali::DALI_KEY_BACKSPACE == keyCode )
+ else if( ( Dali::DALI_KEY_BACKSPACE == keyCode ) ||
+ ( Dali::DevelKey::DALI_KEY_DELETE == keyCode ) )
{
{
- textChanged =
BackspaceKeyEvent(
);
+ textChanged =
DeleteEvent( keyCode
);
// Will request for relayout.
relayoutNeeded = true;
// Will request for relayout.
relayoutNeeded = true;
@@
-3319,6
+3322,7
@@
bool Controller::DoRelayout( const Size& size,
const Vector<CharacterIndex>& glyphsToCharactersMap = mImpl->mModel->mVisualModel->mGlyphsToCharacters;
const Vector<Length>& charactersPerGlyph = mImpl->mModel->mVisualModel->mCharactersPerGlyph;
const Character* const textBuffer = mImpl->mModel->mLogicalModel->mText.Begin();
const Vector<CharacterIndex>& glyphsToCharactersMap = mImpl->mModel->mVisualModel->mGlyphsToCharacters;
const Vector<Length>& charactersPerGlyph = mImpl->mModel->mVisualModel->mCharactersPerGlyph;
const Character* const textBuffer = mImpl->mModel->mLogicalModel->mText.Begin();
+ float outlineWidth = mImpl->mModel->GetOutlineWidth();
// Set the layout parameters.
Layout::Parameters layoutParameters( size,
// Set the layout parameters.
Layout::Parameters layoutParameters( size,
@@
-3333,7
+3337,8
@@
bool Controller::DoRelayout( const Size& size,
glyphsPerCharacterBuffer,
totalNumberOfGlyphs,
mImpl->mModel->mHorizontalAlignment,
glyphsPerCharacterBuffer,
totalNumberOfGlyphs,
mImpl->mModel->mHorizontalAlignment,
- mImpl->mModel->mLineWrapMode );
+ mImpl->mModel->mLineWrapMode,
+ outlineWidth );
// Resize the vector of positions to have the same size than the vector of glyphs.
Vector<Vector2>& glyphPositions = mImpl->mModel->mVisualModel->mGlyphPositions;
// Resize the vector of positions to have the same size than the vector of glyphs.
Vector<Vector2>& glyphPositions = mImpl->mModel->mVisualModel->mGlyphPositions;
@@
-3615,9
+3620,9
@@
void Controller::SelectEvent( float x, float y, bool selectAll )
}
}
}
}
-bool Controller::
BackspaceKeyEvent(
)
+bool Controller::
DeleteEvent( int keyCode
)
{
{
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p
DALI_KEY_BACKSPACE\n", this
);
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p
KeyCode : %d \n", this, keyCode
);
bool removed = false;
bool removed = false;
@@
-3633,13
+3638,20
@@
bool Controller::BackspaceKeyEvent()
{
removed = RemoveSelectedText();
}
{
removed = RemoveSelectedText();
}
- else if(
mImpl->mEventData->mPrimaryCursorPosition > 0
)
+ else if(
( mImpl->mEventData->mPrimaryCursorPosition > 0 ) && ( keyCode == Dali::DALI_KEY_BACKSPACE)
)
{
// Remove the character before the current cursor position
removed = RemoveText( -1,
1,
UPDATE_INPUT_STYLE );
}
{
// Remove the character before the current cursor position
removed = RemoveText( -1,
1,
UPDATE_INPUT_STYLE );
}
+ else if( ( mImpl->mEventData->mPrimaryCursorPosition >= 0 ) && ( keyCode == Dali::DevelKey::DALI_KEY_DELETE ) )
+ {
+ // Remove the character after the current cursor position
+ removed = RemoveText( 0,
+ 1,
+ UPDATE_INPUT_STYLE );
+ }
if( removed )
{
if( removed )
{