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
Fix cursor visible issue on text editing
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
decorator
/
text-decorator.cpp
diff --git
a/dali-toolkit/internal/text/decorator/text-decorator.cpp
b/dali-toolkit/internal/text/decorator/text-decorator.cpp
index
c948701
..
f4d2ca4
100644
(file)
--- a/
dali-toolkit/internal/text/decorator/text-decorator.cpp
+++ b/
dali-toolkit/internal/text/decorator/text-decorator.cpp
@@
-256,7
+256,8
@@
struct Decorator::Impl : public ConnectionTracker
mControlSize = size;
// TODO - Remove this if nothing is active
mControlSize = size;
// TODO - Remove this if nothing is active
- CreateActiveLayer();
+ CreateLayer(mActiveLayer, DecorationType::ACTIVE_LAYER);
+ CreateLayer(mCursorLayer, DecorationType::CURSOR_LAYER);
// Show or hide the cursors
CreateCursors();
// Show or hide the cursors
CreateCursors();
@@
-266,8
+267,8
@@
struct Decorator::Impl : public ConnectionTracker
const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
mPrimaryCursorVisible = (!mHidePrimaryCursorAndGrabHandle) && ((mControlSize.width - (cursor.position.x + mCursorWidth) > -Math::MACHINE_EPSILON_1000) &&
(cursor.position.x > -Math::MACHINE_EPSILON_1000) &&
const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
mPrimaryCursorVisible = (!mHidePrimaryCursorAndGrabHandle) && ((mControlSize.width - (cursor.position.x + mCursorWidth) > -Math::MACHINE_EPSILON_1000) &&
(cursor.position.x > -Math::MACHINE_EPSILON_1000) &&
- (mControlSize.height -
(cursor.position.y + cursor.cursorHeight)
> -Math::MACHINE_EPSILON_1000) &&
- (cursor.position.y > -Math::MACHINE_EPSILON_1000));
+ (mControlSize.height -
cursor.position.y
> -Math::MACHINE_EPSILON_1000) &&
+ (cursor.position.y
+ cursor.cursorHeight
> -Math::MACHINE_EPSILON_1000));
if(mPrimaryCursorVisible)
{
mPrimaryCursor.SetProperty(Actor::Property::POSITION, Vector2(cursor.position.x, cursor.position.y));
if(mPrimaryCursorVisible)
{
mPrimaryCursor.SetProperty(Actor::Property::POSITION, Vector2(cursor.position.x, cursor.position.y));
@@
-280,8
+281,8
@@
struct Decorator::Impl : public ConnectionTracker
const CursorImpl& cursor = mCursor[SECONDARY_CURSOR];
mSecondaryCursorVisible = ((mControlSize.width - (cursor.position.x + mCursorWidth) > -Math::MACHINE_EPSILON_1000) &&
(cursor.position.x > -Math::MACHINE_EPSILON_1000) &&
const CursorImpl& cursor = mCursor[SECONDARY_CURSOR];
mSecondaryCursorVisible = ((mControlSize.width - (cursor.position.x + mCursorWidth) > -Math::MACHINE_EPSILON_1000) &&
(cursor.position.x > -Math::MACHINE_EPSILON_1000) &&
- (mControlSize.height -
(cursor.position.y + cursor.cursorHeight)
> -Math::MACHINE_EPSILON_1000) &&
- (cursor.position.y > -Math::MACHINE_EPSILON_1000));
+ (mControlSize.height -
cursor.position.y
> -Math::MACHINE_EPSILON_1000) &&
+ (cursor.position.y
+ cursor.cursorHeight
> -Math::MACHINE_EPSILON_1000));
if(mSecondaryCursorVisible)
{
mSecondaryCursor.SetProperty(Actor::Property::POSITION, Vector2(cursor.position.x, cursor.position.y));
if(mSecondaryCursorVisible)
{
mSecondaryCursor.SetProperty(Actor::Property::POSITION, Vector2(cursor.position.x, cursor.position.y));
@@
-299,8
+300,8
@@
struct Decorator::Impl : public ConnectionTracker
{
grabHandle.horizontallyVisible = ((mControlSize.width - (grabHandle.position.x + floor(0.5f * mCursorWidth)) > -Math::MACHINE_EPSILON_1000) &&
(grabHandle.position.x > -Math::MACHINE_EPSILON_1000));
{
grabHandle.horizontallyVisible = ((mControlSize.width - (grabHandle.position.x + floor(0.5f * mCursorWidth)) > -Math::MACHINE_EPSILON_1000) &&
(grabHandle.position.x > -Math::MACHINE_EPSILON_1000));
- grabHandle.verticallyVisible = (((mControlSize.height - grabHandle.lineHeight) - grabHandle.position.y > -Math::MACHINE_EPSILON_1000) &&
-
(grabHandle.position.y
> -Math::MACHINE_EPSILON_1000));
+ grabHandle.verticallyVisible = ((
fabsf
(mControlSize.height - grabHandle.lineHeight) - grabHandle.position.y > -Math::MACHINE_EPSILON_1000) &&
+
(grabHandle.position.y + grabHandle.lineHeight
> -Math::MACHINE_EPSILON_1000));
const bool isVisible = grabHandle.horizontallyVisible && grabHandle.verticallyVisible && (!mHidePrimaryCursorAndGrabHandle);
if(isVisible)
const bool isVisible = grabHandle.horizontallyVisible && grabHandle.verticallyVisible && (!mHidePrimaryCursorAndGrabHandle);
if(isVisible)
@@
-334,11
+335,11
@@
struct Decorator::Impl : public ConnectionTracker
primary.horizontallyVisible = ((mControlSize.width - primary.position.x > -Math::MACHINE_EPSILON_1000) &&
(primary.position.x > -Math::MACHINE_EPSILON_1000));
primary.horizontallyVisible = ((mControlSize.width - primary.position.x > -Math::MACHINE_EPSILON_1000) &&
(primary.position.x > -Math::MACHINE_EPSILON_1000));
- primary.verticallyVisible = (((mControlSize.height - primary.lineHeight) - primary.position.y > -Math::MACHINE_EPSILON_1000) &&
+ primary.verticallyVisible = ((
fabsf
(mControlSize.height - primary.lineHeight) - primary.position.y > -Math::MACHINE_EPSILON_1000) &&
(primary.position.y + (primary.verticallyFlipped ? 0.f : primary.lineHeight) > -Math::MACHINE_EPSILON_1000));
secondary.horizontallyVisible = ((mControlSize.width - secondary.position.x > -Math::MACHINE_EPSILON_1000) &&
(secondary.position.x > -Math::MACHINE_EPSILON_1000));
(primary.position.y + (primary.verticallyFlipped ? 0.f : primary.lineHeight) > -Math::MACHINE_EPSILON_1000));
secondary.horizontallyVisible = ((mControlSize.width - secondary.position.x > -Math::MACHINE_EPSILON_1000) &&
(secondary.position.x > -Math::MACHINE_EPSILON_1000));
- secondary.verticallyVisible = (((mControlSize.height - secondary.lineHeight) - secondary.position.y > -Math::MACHINE_EPSILON_1000) &&
+ secondary.verticallyVisible = ((
fabsf
(mControlSize.height - secondary.lineHeight) - secondary.position.y > -Math::MACHINE_EPSILON_1000) &&
(secondary.position.y + (secondary.verticallyFlipped ? 0.f : secondary.lineHeight) > -Math::MACHINE_EPSILON_1000));
const bool primaryVisible = primary.horizontallyVisible && primary.verticallyVisible;
(secondary.position.y + (secondary.verticallyFlipped ? 0.f : secondary.lineHeight) > -Math::MACHINE_EPSILON_1000));
const bool primaryVisible = primary.horizontallyVisible && primary.verticallyVisible;
@@
-665,7
+666,7
@@
struct Decorator::Impl : public ConnectionTracker
if(!mPrimaryCursor.GetParent())
{
if(!mPrimaryCursor.GetParent())
{
- m
Active
Layer.Add(mPrimaryCursor);
+ m
Cursor
Layer.Add(mPrimaryCursor);
}
}
}
}
@@
-681,7
+682,7
@@
struct Decorator::Impl : public ConnectionTracker
if(!mSecondaryCursor.GetParent())
{
if(!mSecondaryCursor.GetParent())
{
- m
Active
Layer.Add(mSecondaryCursor);
+ m
Cursor
Layer.Add(mSecondaryCursor);
}
}
else
}
}
else
@@
-735,23
+736,34
@@
struct Decorator::Impl : public ConnectionTracker
mPanDetector.DetectedSignal().Connect(this, &Decorator::Impl::OnPan);
}
mPanDetector.DetectedSignal().Connect(this, &Decorator::Impl::OnPan);
}
- void Create
ActiveLayer(
)
+ void Create
Layer(Actor& layer, DecorationType type
)
{
{
- if(!
mActiveL
ayer)
+ if(!
l
ayer)
{
{
-
mActiveL
ayer = Actor::New();
+
l
ayer = Actor::New();
#ifdef DECORATOR_DEBUG
#ifdef DECORATOR_DEBUG
- mActiveLayer.SetProperty(Actor::Property::NAME, "ActiveLayerActor");
+ if(type == DecorationType::ACTIVE_LAYER)
+ {
+ layer.SetProperty(Actor::Property::NAME, "ActiveLayerActor");
+ }
+ else if(type == DecorationType::CURSOR_LAYER)
+ {
+ layer.SetProperty(Actor::Property::NAME, "CursorLayerActor");
+ }
#endif
#endif
+ bool needsClipping = false;
+ if(type == DecorationType::CURSOR_LAYER)
+ {
+ needsClipping = true;
+ }
-
mActiveL
ayer.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
-
mActiveL
ayer.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
l
ayer.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+
l
ayer.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
- // Add the active layer telling the controller it doesn't need clipping.
- mController.AddDecoration(mActiveLayer, false);
+ mController.AddDecoration(layer, type, needsClipping);
}
}
-
mActiveL
ayer.RaiseToTop();
+
l
ayer.RaiseToTop();
}
void SetSelectionHandleMarkerSize(HandleImpl& handle)
}
void SetSelectionHandleMarkerSize(HandleImpl& handle)
@@
-1160,7
+1172,7
@@
struct Decorator::Impl : public ConnectionTracker
}
// Add the highlight box telling the controller it needs clipping.
}
// Add the highlight box telling the controller it needs clipping.
- mController.AddDecoration(mHighlightActor, true);
+ mController.AddDecoration(mHighlightActor,
DecorationType::NONE_LAYER,
true);
}
void UpdateHighlight()
}
void UpdateHighlight()
@@
-1881,6
+1893,7
@@
struct Decorator::Impl : public ConnectionTracker
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.
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.
+ Actor mCursorLayer; ///< Actor for cursor layer. this is for cursor clipping.
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.
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.