From: VĂ­ctor Cebollada Date: Tue, 16 Jun 2020 09:02:11 +0000 (+0000) Subject: Merge "Update cursor position when the default font style is changed" into devel... X-Git-Tag: dali_1.9.17~10 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=d402b997c5874a73bfec576eff290af235c1c03d;hp=564e9d67ee51b52b668e9791c13e14beeb63220e Merge "Update cursor position when the default font style is changed" into devel/master --- diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index cb09223..95f54bc 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -835,6 +835,16 @@ void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily ) DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetDefaultFontFamily %s\n", defaultFontFamily.c_str()); mImpl->mFontDefaults->familyDefined = !defaultFontFamily.empty(); + if( mImpl->mEventData ) + { + // Update the cursor position if it's in editing mode + if( EventData::IsEditingState( mImpl->mEventData->mState ) ) + { + mImpl->mEventData->mDecoratorUpdated = true; + mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font family is updated. + } + } + // Clear the font-specific data ClearFontData(); @@ -888,6 +898,16 @@ void Controller::SetDefaultFontWeight( FontWeight weight ) mImpl->mFontDefaults->mFontDescription.weight = weight; mImpl->mFontDefaults->weightDefined = true; + if( mImpl->mEventData ) + { + // Update the cursor position if it's in editing mode + if( EventData::IsEditingState( mImpl->mEventData->mState ) ) + { + mImpl->mEventData->mDecoratorUpdated = true; + mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font weight is updated. + } + } + // Clear the font-specific data ClearFontData(); @@ -959,6 +979,16 @@ void Controller::SetDefaultFontWidth( FontWidth width ) mImpl->mFontDefaults->mFontDescription.width = width; mImpl->mFontDefaults->widthDefined = true; + if( mImpl->mEventData ) + { + // Update the cursor position if it's in editing mode + if( EventData::IsEditingState( mImpl->mEventData->mState ) ) + { + mImpl->mEventData->mDecoratorUpdated = true; + mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font width is updated. + } + } + // Clear the font-specific data ClearFontData(); @@ -1030,6 +1060,16 @@ void Controller::SetDefaultFontSlant( FontSlant slant ) mImpl->mFontDefaults->mFontDescription.slant = slant; mImpl->mFontDefaults->slantDefined = true; + if( mImpl->mEventData ) + { + // Update the cursor position if it's in editing mode + if( EventData::IsEditingState( mImpl->mEventData->mState ) ) + { + mImpl->mEventData->mDecoratorUpdated = true; + mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font slant is updated. + } + } + // Clear the font-specific data ClearFontData(); @@ -1119,6 +1159,16 @@ void Controller::SetDefaultFontSize( float fontSize, FontSizeType type ) } } + if( mImpl->mEventData ) + { + // Update the cursor position if it's in editing mode + if( EventData::IsEditingState( mImpl->mEventData->mState ) ) + { + mImpl->mEventData->mDecoratorUpdated = true; + mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font size is updated. + } + } + // Clear the font-specific data ClearFontData();