From 17dea92691f97b96b9f509672666864906e685cc Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 16 Sep 2020 14:09:45 +0900 Subject: [PATCH] Revert "[Tizen] Change cursor parent from Layer to Actor" This reverts commit 9fd3104c04dd4874fa361d156493a257e76aeefe. --- .../src/dali-toolkit/utc-Dali-TextEditor.cpp | 2 ++ .../src/dali-toolkit/utc-Dali-TextField.cpp | 2 ++ .../text-controls/text-selection-popup.cpp | 2 +- .../controls/text-controls/text-selection-popup.h | 6 +++--- .../text-controls/text-selection-toolbar.cpp | 2 +- .../text-controls/text-selection-toolbar.h | 6 +++--- .../text-controls/text-selection-popup-impl.cpp | 2 +- .../text-controls/text-selection-popup-impl.h | 2 +- .../text-controls/text-selection-toolbar-impl.cpp | 22 +++++++++++----------- .../text-controls/text-selection-toolbar-impl.h | 4 ++-- .../internal/text/decorator/text-decorator.cpp | 4 ++-- 11 files changed, 29 insertions(+), 25 deletions(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index d5cfb41..cb8d8bb 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -1557,6 +1557,8 @@ int utcDaliTextEditorEvent02(void) application.Render(); Actor layer = editor.GetChildAt( 1u ); + DALI_TEST_CHECK( layer.GetProperty< bool >( Actor::Property::IS_LAYER ) ); + DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor. DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index a759941..8bfb93b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -1686,6 +1686,8 @@ int utcDaliTextFieldEvent02(void) application.Render(); Actor layer = field.GetChildAt( 1u ); + DALI_TEST_CHECK( layer.GetProperty< bool >( Actor::Property::IS_LAYER ) ); + DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor. DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION ); diff --git a/dali-toolkit/devel-api/controls/text-controls/text-selection-popup.cpp b/dali-toolkit/devel-api/controls/text-controls/text-selection-popup.cpp index 4b73c88..28a5819 100644 --- a/dali-toolkit/devel-api/controls/text-controls/text-selection-popup.cpp +++ b/dali-toolkit/devel-api/controls/text-controls/text-selection-popup.cpp @@ -66,7 +66,7 @@ void TextSelectionPopup::EnableButtons( Toolkit::TextSelectionPopup::Buttons but GetImpl(*this).EnableButtons( buttonsToEnable ); } -void TextSelectionPopup::RaiseAbove( Actor target ) +void TextSelectionPopup::RaiseAbove( Layer target ) { GetImpl(*this).RaiseAbove( target ); } diff --git a/dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h b/dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h index bb914fb..ccc25cc 100644 --- a/dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h @@ -238,11 +238,11 @@ public: void EnableButtons( Toolkit::TextSelectionPopup::Buttons buttonsToEnable ); /** - * @brief Raises the toolbar's actor above the given @e target actor. + * @brief Raises the toolbar's layer above the given @e target layer. * - * @param[in] target The actor to get above of. + * @param[in] target The layer to get above of. */ - void RaiseAbove( Actor target ); + void RaiseAbove( Layer target ); /** * @brief Show the Popup if not being shown diff --git a/dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.cpp b/dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.cpp index 0def0e0..84bd8db 100644 --- a/dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.cpp +++ b/dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.cpp @@ -71,7 +71,7 @@ void TextSelectionToolbar::ResizeDividers( Size& size ) GetImpl(*this).ResizeDividers( size ); } -void TextSelectionToolbar::RaiseAbove( Actor target ) +void TextSelectionToolbar::RaiseAbove( Layer target ) { GetImpl(*this).RaiseAbove( target ); } diff --git a/dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h b/dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h index 75b26bf..e8adee9 100644 --- a/dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h @@ -123,11 +123,11 @@ public: void ResizeDividers( Size& size ); /** - * @brief Raises the actor above the given @e target actor. + * @brief Raises the layer above the given @e target layer. * - * @param[in] target The actor to get above of. + * @param[in] target The layer to get above of. */ - void RaiseAbove( Actor target ); + void RaiseAbove( Layer target ); /** * @copydoc Toolkit::ScrollView::ScrollTo(const Vector2&) diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp index 6631898..e88adbe 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp @@ -344,7 +344,7 @@ void TextSelectionPopup::EnableButtons( Toolkit::TextSelectionPopup::Buttons but mButtonsChanged = true; } -void TextSelectionPopup::RaiseAbove( Actor target ) +void TextSelectionPopup::RaiseAbove( Layer target ) { if( mToolbar ) { diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h index a94fee9..09066c0 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h @@ -122,7 +122,7 @@ public: /** * @copydoc Toolkit::TextSelectionPopup::RaiseAbove() */ - void RaiseAbove( Actor target ); + void RaiseAbove( Layer target ); /** * @copydoc Toolkit::TextSelectionPopup::ShowPopup() diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp index 8cdd32a..4a06886 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp @@ -184,10 +184,10 @@ void TextSelectionToolbar::OnRelayout( const Vector2& size, RelayoutContainer& c void TextSelectionToolbar::SetPopupMaxSize( const Size& maxSize ) { mMaxSize = maxSize; - if( mScrollView && mToolbarActor ) + if (mScrollView && mToolbarLayer ) { mScrollView.SetProperty( Actor::Property::MAXIMUM_SIZE, mMaxSize ); - mToolbarActor.SetProperty( Actor::Property::MAXIMUM_SIZE, mMaxSize ); + mToolbarLayer.SetProperty( Actor::Property::MAXIMUM_SIZE, mMaxSize ); } } @@ -224,11 +224,11 @@ void TextSelectionToolbar::SetUp() self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS ); - // Create Actor to house the toolbar. - mToolbarActor = Actor::New(); - mToolbarActor.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS ); - mToolbarActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - mToolbarActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + // Create Layer to house the toolbar. + mToolbarLayer = Layer::New(); + mToolbarLayer.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS ); + mToolbarLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mToolbarLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); if( !mScrollView ) { @@ -243,9 +243,9 @@ void TextSelectionToolbar::SetUp() mTableOfButtons.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); mScrollView.Add( mTableOfButtons ); - mToolbarActor.Add( mScrollView ); + mToolbarLayer.Add( mScrollView ); - self.Add( mToolbarActor ); + self.Add( mToolbarLayer ); } void TextSelectionToolbar::SetUpScrollBar( bool enable ) @@ -316,9 +316,9 @@ void TextSelectionToolbar::ResizeDividers( Size& size ) RelayoutRequest(); } -void TextSelectionToolbar::RaiseAbove( Actor target ) +void TextSelectionToolbar::RaiseAbove( Layer target ) { - mToolbarActor.RaiseAbove( target ); + mToolbarLayer.RaiseAbove( target ); } void TextSelectionToolbar::SetScrollBarPadding( const Vector2& padding ) diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h b/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h index 5cc4fda..5052ded 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h @@ -83,7 +83,7 @@ public: /** * @copydoc Toolkit::TextSelectionToolbar::RaiseAbove() */ - void RaiseAbove( Actor target ); + void RaiseAbove( Layer target ); /** * Sets the scroll bar padding. @@ -180,7 +180,7 @@ private: private: // Data - Actor mToolbarActor; ///< The actor used to house the toolbar. + Layer mToolbarLayer; ///< The layer used to house the toolbar. Toolkit::TableView mTableOfButtons; ///< Actor which holds all the buttons, sensitivity can be set on buttons via this actor Toolkit::ScrollView mScrollView; ///< Provides scrolling of Toolbar when content does not fit. Toolkit::ScrollBar mScrollBar; ///< An horizontal scroll bar for the text's popup options. diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index ae4140f..7f5a49d 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -767,7 +767,7 @@ struct Decorator::Impl : public ConnectionTracker { if( !mActiveLayer ) { - mActiveLayer = Actor::New(); + mActiveLayer = Layer::New(); #ifdef DECORATOR_DEBUG mActiveLayer.SetProperty( Actor::Property::NAME, "ActiveLayerActor" ); #endif @@ -1884,7 +1884,7 @@ struct Decorator::Impl : public ConnectionTracker Timer mCursorBlinkTimer; ///< Timer to signal cursor to blink Timer mScrollTimer; ///< Timer used to scroll the text when the grab handle is moved close to the edges. - Actor mActiveLayer; ///< Actor for active handles and alike that ensures they are above all else. + Layer mActiveLayer; ///< Layer for active handles and alike that ensures they are above all else. PropertyNotification mHandleVerticalLessThanNotification; ///< Notifies when the 'y' coord of the active layer is less than a given value. PropertyNotification mHandleVerticalGreaterThanNotification; ///< Notifies when the 'y' coord of the active layer is grater than a given value. PropertyNotification mHandleHorizontalLessThanNotification; ///< Notifies when the 'x' coord of the active layer is less than a given value. -- 2.7.4