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
[AT-SPI] Squashed implementation
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
controls
/
tool-bar
/
tool-bar-impl.cpp
diff --git
a/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
b/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
index
1dc683b
..
0ca6e72
100644
(file)
--- a/
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
+++ b/
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
4
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
7
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-19,13
+19,13
@@
#include "tool-bar-impl.h"
// EXTERNAL INCLUDES
#include "tool-bar-impl.h"
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/
devel
-api/object/type-registry-helper.h>
+#include <dali/
public
-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
+#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
namespace Dali
{
namespace Dali
{
@@
-48,7
+48,7
@@
DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ToolBar, Toolkit::Control, Create )
DALI_TYPE_REGISTRATION_END()
const float DEFAULT_RELATIVE_SIZE( 0.1f );
DALI_TYPE_REGISTRATION_END()
const float DEFAULT_RELATIVE_SIZE( 0.1f );
-const Toolkit::Alignment::Type DEFAULT_ALIGNMENT( Toolkit::Alignment::H
orizontalLeft
);
+const Toolkit::Alignment::Type DEFAULT_ALIGNMENT( Toolkit::Alignment::H
ORIZONTAL_LEFT
);
} // namespace
Toolkit::ToolBar ToolBar::New()
} // namespace
Toolkit::ToolBar ToolBar::New()
@@
-72,7
+72,7
@@
void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment:
unsigned int index = 0;
switch( alignment )
{
unsigned int index = 0;
switch( alignment )
{
- case Toolkit::Alignment::H
orizontalLeft
:
+ case Toolkit::Alignment::H
ORIZONTAL_LEFT
:
{
index = mLeftOffset;
++mLeftOffset;
{
index = mLeftOffset;
++mLeftOffset;
@@
-80,14
+80,14
@@
void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment:
++mRightBase;
break;
}
++mRightBase;
break;
}
- case Toolkit::Alignment::H
orizontalCenter
:
+ case Toolkit::Alignment::H
ORIZONTAL_CENTER
:
{
index = mCenterBase + mCenterOffset;
++mCenterOffset;
++mRightBase;
break;
}
{
index = mCenterBase + mCenterOffset;
++mCenterOffset;
++mRightBase;
break;
}
- case Toolkit::Alignment::H
orizontalRight
:
+ case Toolkit::Alignment::H
ORIZONTAL_RIGHT
:
{
index = mRightBase - mRightOffset;
++mRightBase;
{
index = mRightBase - mRightOffset;
++mRightBase;
@@
-105,7
+105,7
@@
void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment:
// Create an alignment container where to place the control.
Toolkit::Alignment alignmentContainer = Toolkit::Alignment::New( alignment );
// Create an alignment container where to place the control.
Toolkit::Alignment alignmentContainer = Toolkit::Alignment::New( alignment );
- alignmentContainer.Set
SizeScalePolicy(
SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
+ alignmentContainer.Set
Property( Actor::Property::SIZE_SCALE_POLICY,
SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
alignmentContainer.SetPadding( padding );
alignmentContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
alignmentContainer.Add( control );
alignmentContainer.SetPadding( padding );
alignmentContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
alignmentContainer.Add( control );
@@
-123,7
+123,7
@@
void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment:
// Update spaces between left, center and right groups of controls.
switch( alignment )
{
// Update spaces between left, center and right groups of controls.
switch( alignment )
{
- case Toolkit::Alignment::H
orizontalLeft
:
+ case Toolkit::Alignment::H
ORIZONTAL_LEFT
:
{
mLeftRelativeSpace -= relativeSize;
if ( mLeftRelativeSpace < 0.f )
{
mLeftRelativeSpace -= relativeSize;
if ( mLeftRelativeSpace < 0.f )
@@
-132,7
+132,7
@@
void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment:
}
break;
}
}
break;
}
- case Toolkit::Alignment::H
orizontalCenter
:
+ case Toolkit::Alignment::H
ORIZONTAL_CENTER
:
{
mLeftRelativeSpace -= 0.5f * relativeSize;
if ( mLeftRelativeSpace < 0.f )
{
mLeftRelativeSpace -= 0.5f * relativeSize;
if ( mLeftRelativeSpace < 0.f )
@@
-146,7
+146,7
@@
void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment:
}
break;
}
}
break;
}
- case Toolkit::Alignment::H
orizontalRight
:
+ case Toolkit::Alignment::H
ORIZONTAL_RIGHT
:
{
mRightRelativeSpace -= relativeSize;
if ( mRightRelativeSpace < 0.f )
{
mRightRelativeSpace -= relativeSize;
if ( mRightRelativeSpace < 0.f )
@@
-180,18
+180,18
@@
void ToolBar::RemoveControl( Actor control )
// Update spaces between left, center and right groups of controls.
if( 1.0 > mAccumulatedRelativeSpace )
{
// Update spaces between left, center and right groups of controls.
if( 1.0 > mAccumulatedRelativeSpace )
{
- Toolkit::Alignment::Type alignment = Toolkit::Alignment::H
orizontalLeft
;
+ Toolkit::Alignment::Type alignment = Toolkit::Alignment::H
ORIZONTAL_LEFT
;
if( position.columnIndex < mLeftOffset )
{
if( position.columnIndex < mLeftOffset )
{
- alignment = Toolkit::Alignment::H
orizontalLeft
;
+ alignment = Toolkit::Alignment::H
ORIZONTAL_LEFT
;
}
else if( ( position.columnIndex > mLeftOffset ) && ( position.columnIndex < mCenterBase + mCenterOffset ) )
{
}
else if( ( position.columnIndex > mLeftOffset ) && ( position.columnIndex < mCenterBase + mCenterOffset ) )
{
- alignment = Toolkit::Alignment::H
orizontalCenter
;
+ alignment = Toolkit::Alignment::H
ORIZONTAL_CENTER
;
}
else if( position.columnIndex > mCenterBase + mCenterOffset )
{
}
else if( position.columnIndex > mCenterBase + mCenterOffset )
{
- alignment = Toolkit::Alignment::H
orizontalRight
;
+ alignment = Toolkit::Alignment::H
ORIZONTAL_RIGHT
;
}
else
{
}
else
{
@@
-202,7
+202,7
@@
void ToolBar::RemoveControl( Actor control )
switch( alignment )
{
switch( alignment )
{
- case Toolkit::Alignment::H
orizontalLeft
:
+ case Toolkit::Alignment::H
ORIZONTAL_LEFT
:
{
mLeftRelativeSpace += relativeSize;
if ( mLeftRelativeSpace < 0.f )
{
mLeftRelativeSpace += relativeSize;
if ( mLeftRelativeSpace < 0.f )
@@
-211,7
+211,7
@@
void ToolBar::RemoveControl( Actor control )
}
break;
}
}
break;
}
- case Toolkit::Alignment::H
orizontalCenter
:
+ case Toolkit::Alignment::H
ORIZONTAL_CENTER
:
{
mLeftRelativeSpace += 0.5f * relativeSize;
if ( mLeftRelativeSpace < 0.f )
{
mLeftRelativeSpace += 0.5f * relativeSize;
if ( mLeftRelativeSpace < 0.f )
@@
-225,7
+225,7
@@
void ToolBar::RemoveControl( Actor control )
}
break;
}
}
break;
}
- case Toolkit::Alignment::H
orizontalRight
:
+ case Toolkit::Alignment::H
ORIZONTAL_RIGHT
:
{
mRightRelativeSpace += relativeSize;
if ( mRightRelativeSpace < 0.f )
{
mRightRelativeSpace += relativeSize;
if ( mRightRelativeSpace < 0.f )
@@
-276,7
+276,7
@@
void ToolBar::RemoveControl( Actor control )
}
ToolBar::ToolBar()
}
ToolBar::ToolBar()
-: Control( ControlBehaviour(
ACTOR_BEHAVIOUR_NONE
) ),
+: Control( ControlBehaviour(
CONTROL_BEHAVIOUR_DEFAULT
) ),
mLayout(),
mLeftOffset( 0 ),
mCenterBase( 1 ),
mLayout(),
mLeftOffset( 0 ),
mCenterBase( 1 ),
@@
-289,6
+289,10
@@
ToolBar::ToolBar()
mInitializing( false ),
mControls()
{
mInitializing( false ),
mControls()
{
+ DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) {
+ return std::unique_ptr< Dali::Accessibility::Accessible >(
+ new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::TOOL_BAR, true ) );
+ } );
}
ToolBar::~ToolBar()
}
ToolBar::~ToolBar()
@@
-301,9
+305,9
@@
void ToolBar::OnInitialize()
// Layout
mLayout = Toolkit::TableView::New( 1, 1 );
// Layout
mLayout = Toolkit::TableView::New( 1, 1 );
- mLayout.Set
Name(
"TOOLBAR_LAYOUT" );
+ mLayout.Set
Property( Dali::Actor::Property::NAME,
"TOOLBAR_LAYOUT" );
mLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mLayout.SetP
ositionInheritanceMode( Dali::USE_PARENT_POSITION
);
+ mLayout.SetP
roperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER
);
Self().Add( mLayout );
Self().Add( mLayout );
@@
-316,7
+320,7
@@
void ToolBar::OnInitialize()
mLayout.SetRelativeWidth( 1, mRightRelativeSpace );
}
mLayout.SetRelativeWidth( 1, mRightRelativeSpace );
}
-void ToolBar::OnC
ontrolC
hildAdd(Actor& child)
+void ToolBar::OnChildAdd(Actor& child)
{
if( !mInitializing )
{
{
if( !mInitializing )
{
@@
-331,9
+335,11
@@
void ToolBar::OnControlChildAdd(Actor& child)
AddControl( child, DEFAULT_RELATIVE_SIZE, DEFAULT_ALIGNMENT, Toolkit::ToolBar::DEFAULT_PADDING );
}
AddControl( child, DEFAULT_RELATIVE_SIZE, DEFAULT_ALIGNMENT, Toolkit::ToolBar::DEFAULT_PADDING );
}
- // No OnC
ontrolC
hildRemove method required because Actors are added to the mLayout table view, so if an
+ // No OnChildRemove method required because Actors are added to the mLayout table view, so if an
// actor is removed using the Actor::RemoveChild method it will not remove anything because the
// actor is in mLayout not in Self().
// actor is removed using the Actor::RemoveChild method it will not remove anything because the
// actor is in mLayout not in Self().
+
+ Control::OnChildAdd( child );
}
} // namespace Internal
}
} // namespace Internal