Commit 51a67042772c3a811a8a602a2f9339b90dc4b348
Merge remote-tracking branch 'origin/tizen' into devel/new_mesh
Conflicts: examples/animated-shapes/animated-shapes-example.cpp examples/bubble-effect/bubble-effect-example.cpp examples/new-window/new-window-example.cpp examples/path-animation/path-animation.cpp Change-Id: I0e3fe040dfe9faaf9074617294d1fde7f0b7ef67
Showing
45 changed files
with
308 additions
and
368 deletions
builder/dali-builder.cpp
| ... | ... | @@ -28,8 +28,8 @@ |
| 28 | 28 | |
| 29 | 29 | #include <dali/dali.h> |
| 30 | 30 | #include <dali-toolkit/dali-toolkit.h> |
| 31 | -#include <dali-toolkit/public-api/builder/builder.h> | |
| 32 | -#include <dali-toolkit/public-api/builder/tree-node.h> | |
| 31 | +#include <dali-toolkit/devel-api/builder/builder.h> | |
| 32 | +#include <dali-toolkit/devel-api/builder/tree-node.h> | |
| 33 | 33 | #include <iostream> |
| 34 | 34 | #include <map> |
| 35 | 35 | #include <string> | ... | ... |
com.samsung.dali-demo.xml
| ... | ... | @@ -86,7 +86,7 @@ |
| 86 | 86 | <label>Emojis Text Label</label> |
| 87 | 87 | </ui-application> |
| 88 | 88 | <ui-application appid="text-field.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-field.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> |
| 89 | - <label>Text Label</label> | |
| 89 | + <label>Text Field</label> | |
| 90 | 90 | </ui-application> |
| 91 | 91 | <ui-application appid="text-message-field.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-message-field.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> |
| 92 | 92 | <label>Text Label</label> | ... | ... |
demo/dali-demo.cpp
| ... | ... | @@ -31,7 +31,7 @@ int main(int argc, char **argv) |
| 31 | 31 | textdomain(DALI_DEMO_DOMAIN_LOCAL); |
| 32 | 32 | setlocale(LC_ALL, DALI_LANG); |
| 33 | 33 | |
| 34 | - Application app = Application::New(&argc, &argv); | |
| 34 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 35 | 35 | |
| 36 | 36 | // Create the demo launcher |
| 37 | 37 | DaliTableView demo(app); |
| ... | ... | @@ -53,6 +53,7 @@ int main(int argc, char **argv) |
| 53 | 53 | demo.AddExample(Example("builder.example", DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI)); |
| 54 | 54 | demo.AddExample(Example("image-scaling-and-filtering.example", DALI_DEMO_STR_TITLE_IMAGE_FITTING_SAMPLING)); |
| 55 | 55 | demo.AddExample(Example("image-scaling-irregular-grid.example", DALI_DEMO_STR_TITLE_IMAGE_SCALING)); |
| 56 | + demo.AddExample(Example("text-field.example", DALI_DEMO_STR_TITLE_TEXT_FIELD)); | |
| 56 | 57 | demo.AddExample(Example("text-label.example", DALI_DEMO_STR_TITLE_TEXT_LABEL)); |
| 57 | 58 | demo.AddExample(Example("text-label-multi-language.example", DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE)); |
| 58 | 59 | demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT)); | ... | ... |
demo/dali-table-view.cpp
| ... | ... | @@ -23,6 +23,8 @@ |
| 23 | 23 | #include <sstream> |
| 24 | 24 | #include <unistd.h> |
| 25 | 25 | #include <dali/devel-api/images/distance-field.h> |
| 26 | +#include <dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h> | |
| 27 | +#include <dali-toolkit/devel-api/shader-effects/distance-field-effect.h> | |
| 26 | 28 | |
| 27 | 29 | // INTERNAL INCLUDES |
| 28 | 30 | #include "shared/view.h" |
| ... | ... | @@ -202,8 +204,6 @@ void DaliTableView::SortAlphabetically( bool sortAlphabetically ) |
| 202 | 204 | |
| 203 | 205 | void DaliTableView::Initialize( Application& application ) |
| 204 | 206 | { |
| 205 | - DemoHelper::RequestThemeChange(); | |
| 206 | - | |
| 207 | 207 | Stage::GetCurrent().KeyEventSignal().Connect( this, &DaliTableView::OnKeyEvent ); |
| 208 | 208 | |
| 209 | 209 | const Vector2 stageSize = Stage::GetCurrent().GetSize(); |
| ... | ... | @@ -317,12 +317,10 @@ void DaliTableView::Initialize( Application& application ) |
| 317 | 317 | winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); |
| 318 | 318 | |
| 319 | 319 | // Set initial orientation |
| 320 | - Dali::Orientation orientation = winHandle.GetOrientation(); | |
| 321 | - | |
| 322 | - unsigned int degrees = winHandle.GetOrientation().GetDegrees(); | |
| 320 | + unsigned int degrees = 0; | |
| 323 | 321 | Rotate( degrees ); |
| 324 | 322 | |
| 325 | - orientation.ChangedSignal().Connect( this, &DaliTableView::OrientationChanged ); | |
| 323 | + //orientation.ChangedSignal().Connect( this, &DaliTableView::OrientationChanged ); | |
| 326 | 324 | |
| 327 | 325 | winHandle.ShowIndicator( Dali::Window::INVISIBLE ); |
| 328 | 326 | |
| ... | ... | @@ -389,12 +387,12 @@ void DaliTableView::Populate() |
| 389 | 387 | const Example& example = ( *iter ); |
| 390 | 388 | |
| 391 | 389 | Actor tile = CreateTile( example.name, example.title, Vector3( tileParentMultiplier, tileParentMultiplier, 1.0f ), true ); |
| 392 | - FocusManager focusManager = FocusManager::Get(); | |
| 393 | - focusManager.SetFocusOrder( tile, ++exampleCount ); | |
| 394 | - focusManager.SetAccessibilityAttribute( tile, Dali::Toolkit::FocusManager::ACCESSIBILITY_LABEL, | |
| 390 | + AccessibilityFocusManager accessibilityFocusManager = AccessibilityFocusManager::Get(); | |
| 391 | + accessibilityFocusManager.SetFocusOrder( tile, ++exampleCount ); | |
| 392 | + accessibilityFocusManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityFocusManager::ACCESSIBILITY_LABEL, | |
| 395 | 393 | example.title ); |
| 396 | - focusManager.SetAccessibilityAttribute( tile, Dali::Toolkit::FocusManager::ACCESSIBILITY_TRAIT, "Tile" ); | |
| 397 | - focusManager.SetAccessibilityAttribute( tile, Dali::Toolkit::FocusManager::ACCESSIBILITY_HINT, | |
| 394 | + accessibilityFocusManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityFocusManager::ACCESSIBILITY_TRAIT, "Tile" ); | |
| 395 | + accessibilityFocusManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityFocusManager::ACCESSIBILITY_HINT, | |
| 398 | 396 | "You can run this example" ); |
| 399 | 397 | |
| 400 | 398 | tile.SetPadding( Padding( margin, margin, margin, margin ) ); |
| ... | ... | @@ -553,7 +551,7 @@ bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event ) |
| 553 | 551 | std::string name = actor.GetName(); |
| 554 | 552 | ExampleMapConstIter iter = mExampleMap.find( name ); |
| 555 | 553 | |
| 556 | - FocusManager focusManager = FocusManager::Get(); | |
| 554 | + AccessibilityFocusManager accessibilityFocusManager = AccessibilityFocusManager::Get(); | |
| 557 | 555 | |
| 558 | 556 | if( iter != mExampleMap.end() ) |
| 559 | 557 | { |
| ... | ... | @@ -596,11 +594,11 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation& source ) |
| 596 | 594 | if( name == BUTTON_QUIT ) |
| 597 | 595 | { |
| 598 | 596 | // Move focus to the OK button |
| 599 | - FocusManager focusManager = FocusManager::Get(); | |
| 597 | + AccessibilityFocusManager accessibilityFocusManager = AccessibilityFocusManager::Get(); | |
| 600 | 598 | |
| 601 | 599 | // Enable the group mode and wrap mode |
| 602 | - focusManager.SetGroupMode( true ); | |
| 603 | - focusManager.SetWrapMode( true ); | |
| 600 | + accessibilityFocusManager.SetGroupMode( true ); | |
| 601 | + accessibilityFocusManager.SetWrapMode( true ); | |
| 604 | 602 | } |
| 605 | 603 | } |
| 606 | 604 | else |
| ... | ... | @@ -632,8 +630,8 @@ void DaliTableView::OnScrollComplete( const Dali::Vector2& position ) |
| 632 | 630 | mScrolling = false; |
| 633 | 631 | |
| 634 | 632 | // move focus to 1st item of new page |
| 635 | - FocusManager focusManager = FocusManager::Get(); | |
| 636 | - focusManager.SetCurrentFocusActor(mPages[mScrollView.GetCurrentPage()].GetChildAt(0) ); | |
| 633 | + AccessibilityFocusManager accessibilityFocusManager = AccessibilityFocusManager::Get(); | |
| 634 | + accessibilityFocusManager.SetCurrentFocusActor(mPages[mScrollView.GetCurrentPage()].GetChildAt(0) ); | |
| 637 | 635 | } |
| 638 | 636 | |
| 639 | 637 | bool DaliTableView::OnScrollTouched( Actor actor, const TouchEvent& event ) |
| ... | ... | @@ -892,7 +890,7 @@ void DaliTableView::PlayAnimation() |
| 892 | 890 | mAnimationTimer.SetInterval( BACKGROUND_ANIMATION_DURATION ); |
| 893 | 891 | } |
| 894 | 892 | |
| 895 | -Dali::Actor DaliTableView::OnKeyboardPreFocusChange( Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocusNavigationDirection direction ) | |
| 893 | +Dali::Actor DaliTableView::OnKeyboardPreFocusChange( Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocus::Direction direction ) | |
| 896 | 894 | { |
| 897 | 895 | Actor nextFocusActor = proposed; |
| 898 | 896 | |
| ... | ... | @@ -907,22 +905,22 @@ Dali::Actor DaliTableView::OnKeyboardPreFocusChange( Dali::Actor current, Dali:: |
| 907 | 905 | // in the given direction. We should work out which page to scroll to next. |
| 908 | 906 | int currentPage = mScrollView.GetCurrentPage(); |
| 909 | 907 | int newPage = currentPage; |
| 910 | - if( direction == Dali::Toolkit::Control::Left ) | |
| 908 | + if( direction == Dali::Toolkit::Control::KeyboardFocus::LEFT ) | |
| 911 | 909 | { |
| 912 | 910 | newPage--; |
| 913 | 911 | } |
| 914 | - else if( direction == Dali::Toolkit::Control::Right ) | |
| 912 | + else if( direction == Dali::Toolkit::Control::KeyboardFocus::RIGHT ) | |
| 915 | 913 | { |
| 916 | 914 | newPage++; |
| 917 | 915 | } |
| 918 | 916 | |
| 919 | - newPage = std::max(0, std::min(static_cast<int>(mScrollRulerX->GetTotalPages() - 1), newPage)); | |
| 917 | + newPage = std::max(0, std::min(mTotalPages - 1, newPage)); | |
| 920 | 918 | if( newPage == currentPage ) |
| 921 | 919 | { |
| 922 | - if( direction == Dali::Toolkit::Control::Left ) | |
| 920 | + if( direction == Dali::Toolkit::Control::KeyboardFocus::LEFT ) | |
| 923 | 921 | { |
| 924 | - newPage = mScrollRulerX->GetTotalPages() - 1; | |
| 925 | - } else if( direction == Dali::Toolkit::Control::Right ) | |
| 922 | + newPage = mTotalPages - 1; | |
| 923 | + } else if( direction == Dali::Toolkit::Control::KeyboardFocus::RIGHT ) | |
| 926 | 924 | { |
| 927 | 925 | newPage = 0; |
| 928 | 926 | } |
| ... | ... | @@ -931,7 +929,7 @@ Dali::Actor DaliTableView::OnKeyboardPreFocusChange( Dali::Actor current, Dali:: |
| 931 | 929 | // Scroll to the page in the given direction |
| 932 | 930 | mScrollView.ScrollTo(newPage); |
| 933 | 931 | |
| 934 | - if( direction == Dali::Toolkit::Control::Left ) | |
| 932 | + if( direction == Dali::Toolkit::Control::KeyboardFocus::LEFT ) | |
| 935 | 933 | { |
| 936 | 934 | // Work out the cell position for the last tile |
| 937 | 935 | int remainingExamples = mExampleList.size() - newPage * EXAMPLES_PER_PAGE; |
| ... | ... | @@ -939,7 +937,7 @@ Dali::Actor DaliTableView::OnKeyboardPreFocusChange( Dali::Actor current, Dali:: |
| 939 | 937 | int colPos = remainingExamples >= EXAMPLES_PER_PAGE ? EXAMPLES_PER_ROW - 1 : ( remainingExamples % EXAMPLES_PER_PAGE - rowPos * EXAMPLES_PER_ROW - 1 ); |
| 940 | 938 | |
| 941 | 939 | // Move the focus to the last tile in the new page. |
| 942 | - nextFocusActor = mPages[newPage].GetChildAt(colPos * EXAMPLES_PER_ROW + rowPos); | |
| 940 | + nextFocusActor = mPages[newPage].GetChildAt(rowPos * EXAMPLES_PER_ROW + colPos); | |
| 943 | 941 | } |
| 944 | 942 | else |
| 945 | 943 | { | ... | ... |
demo/dali-table-view.h
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | |
| 23 | 23 | #include <dali/dali.h> |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 25 | 26 | |
| 26 | 27 | class Example; |
| 27 | 28 | |
| ... | ... | @@ -344,7 +345,7 @@ private: // Application callbacks & implementation |
| 344 | 345 | * @param[in] direction The direction to move the focus |
| 345 | 346 | * @return The actor to move the keyboard focus to. |
| 346 | 347 | */ |
| 347 | - Dali::Actor OnKeyboardPreFocusChange( Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocusNavigationDirection direction ); | |
| 348 | + Dali::Actor OnKeyboardPreFocusChange( Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocus::Direction direction ); | |
| 348 | 349 | |
| 349 | 350 | /** |
| 350 | 351 | * Callback when the keyboard focused actor is activated. | ... | ... |
examples/atlas/atlas-example.cpp
| ... | ... | @@ -226,7 +226,7 @@ void RunTest( Application& application ) |
| 226 | 226 | // |
| 227 | 227 | int main( int argc, char **argv ) |
| 228 | 228 | { |
| 229 | - gApplication = Application::New( &argc, &argv ); | |
| 229 | + gApplication = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 230 | 230 | |
| 231 | 231 | RunTest( gApplication ); |
| 232 | 232 | ... | ... |
examples/blocks/blocks-example.cpp
| ... | ... | @@ -226,8 +226,6 @@ public: |
| 226 | 226 | */ |
| 227 | 227 | void Create(Application& application) |
| 228 | 228 | { |
| 229 | - DemoHelper::RequestThemeChange(); | |
| 230 | - | |
| 231 | 229 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); |
| 232 | 230 | |
| 233 | 231 | // Creates a default view with a default tool bar. |
| ... | ... | @@ -841,7 +839,7 @@ void RunTest(Application& app) |
| 841 | 839 | |
| 842 | 840 | int main(int argc, char **argv) |
| 843 | 841 | { |
| 844 | - Application app = Application::New(&argc, &argv); | |
| 842 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 845 | 843 | |
| 846 | 844 | RunTest(app); |
| 847 | 845 | ... | ... |
examples/bubble-effect/bubble-effect-example.cpp
| ... | ... | @@ -17,6 +17,7 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h> | |
| 20 | 21 | #include "shared/view.h" |
| 21 | 22 | |
| 22 | 23 | using namespace Dali; |
| ... | ... | @@ -91,8 +92,6 @@ private: |
| 91 | 92 | // The Init signal is received once (only) during the Application lifetime |
| 92 | 93 | void Create(Application& app) |
| 93 | 94 | { |
| 94 | - DemoHelper::RequestThemeChange(); | |
| 95 | - | |
| 96 | 95 | Stage stage = Stage::GetCurrent(); |
| 97 | 96 | Vector2 stageSize = stage.GetSize(); |
| 98 | 97 | |
| ... | ... | @@ -101,9 +100,8 @@ private: |
| 101 | 100 | // Creates a default view with a default tool bar. |
| 102 | 101 | // The view is added to the stage. |
| 103 | 102 | Toolkit::ToolBar toolBar; |
| 104 | - Toolkit::Control view; | |
| 105 | 103 | Layer content = DemoHelper::CreateView( app, |
| 106 | - view, | |
| 104 | + mBackground, | |
| 107 | 105 | toolBar, |
| 108 | 106 | "", |
| 109 | 107 | TOOLBAR_IMAGE, |
| ... | ... | @@ -141,16 +139,14 @@ private: |
| 141 | 139 | content.Add( bubbleRoot ); |
| 142 | 140 | |
| 143 | 141 | // Add the background image actor to stage |
| 144 | - mBackgroundActor = ImageActor::New( mBackgroundImage ); | |
| 145 | - mBackgroundActor.SetParentOrigin( ParentOrigin::CENTER ); | |
| 146 | - content.Add(mBackgroundActor); | |
| 142 | + mBackground.SetBackgroundImage( mBackgroundImage ); | |
| 147 | 143 | |
| 148 | 144 | // Set up the timer to emit bubble regularly when the finger is touched down but not moved |
| 149 | 145 | mTimerForBubbleEmission = Timer::New( mTimerInterval ); |
| 150 | 146 | mTimerForBubbleEmission.TickSignal().Connect(this, &BubbleEffectExample::OnTimerTick); |
| 151 | 147 | |
| 152 | 148 | // Connect the callback to the touch signal on the background |
| 153 | - mBackgroundActor.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch ); | |
| 149 | + mBackground.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch ); | |
| 154 | 150 | } |
| 155 | 151 | |
| 156 | 152 | |
| ... | ... | @@ -260,7 +256,7 @@ private: |
| 260 | 256 | |
| 261 | 257 | mBubbleEmitter.SetBackground( mBackgroundImage, mHSVDelta ); |
| 262 | 258 | |
| 263 | - mBackgroundActor.SetImage( mBackgroundImage ); | |
| 259 | + mBackground.SetBackgroundImage( mBackgroundImage ); | |
| 264 | 260 | } |
| 265 | 261 | else if( button == mChangeBubbleShapeButton ) |
| 266 | 262 | { |
| ... | ... | @@ -287,7 +283,7 @@ private: |
| 287 | 283 | |
| 288 | 284 | Application& mApp; |
| 289 | 285 | Image mBackgroundImage; |
| 290 | - ImageActor mBackgroundActor; | |
| 286 | + Dali::Toolkit::Control mBackground; | |
| 291 | 287 | |
| 292 | 288 | Toolkit::BubbleEmitter mBubbleEmitter; |
| 293 | 289 | Animation mEmitAnimation; |
| ... | ... | @@ -322,7 +318,7 @@ RunTest(Application& app) |
| 322 | 318 | int |
| 323 | 319 | main(int argc, char **argv) |
| 324 | 320 | { |
| 325 | - Application app = Application::New(&argc, &argv); | |
| 321 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 326 | 322 | |
| 327 | 323 | RunTest(app); |
| 328 | 324 | ... | ... |
examples/builder/examples.cpp
| ... | ... | @@ -22,9 +22,10 @@ |
| 22 | 22 | |
| 23 | 23 | #include <dali/dali.h> |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | -#include <dali-toolkit/public-api/builder/builder.h> | |
| 26 | -#include <dali-toolkit/public-api/builder/tree-node.h> | |
| 27 | -#include <dali-toolkit/public-api/builder/json-parser.h> | |
| 25 | +#include <dali-toolkit/devel-api/builder/builder.h> | |
| 26 | +#include <dali-toolkit/devel-api/builder/tree-node.h> | |
| 27 | +#include <dali-toolkit/devel-api/builder/json-parser.h> | |
| 28 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 28 | 29 | #include <map> |
| 29 | 30 | #include <string> |
| 30 | 31 | #include <fstream> |
| ... | ... | @@ -492,8 +493,6 @@ public: |
| 492 | 493 | |
| 493 | 494 | void Create(Application& app) |
| 494 | 495 | { |
| 495 | - DemoHelper::RequestThemeChange(); | |
| 496 | - | |
| 497 | 496 | Stage stage = Stage::GetCurrent(); |
| 498 | 497 | |
| 499 | 498 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleApp::OnKeyEvent); |
| ... | ... | @@ -617,7 +616,7 @@ int main(int argc, char **argv) |
| 617 | 616 | } |
| 618 | 617 | } |
| 619 | 618 | |
| 620 | - Application app = Application::New(&argc, &argv); | |
| 619 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 621 | 620 | |
| 622 | 621 | ExampleApp dali_app(app); |
| 623 | 622 | ... | ... |
examples/buttons/buttons-example.cpp
| ... | ... | @@ -96,8 +96,6 @@ class ButtonsController: public ConnectionTracker |
| 96 | 96 | { |
| 97 | 97 | // The Init signal is received once (only) during the Application lifetime |
| 98 | 98 | |
| 99 | - DemoHelper::RequestThemeChange(); | |
| 100 | - | |
| 101 | 99 | // Respond to key events |
| 102 | 100 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ButtonsController::OnKeyEvent); |
| 103 | 101 | |
| ... | ... | @@ -527,7 +525,7 @@ void RunTest( Application& application ) |
| 527 | 525 | // |
| 528 | 526 | int main( int argc, char **argv ) |
| 529 | 527 | { |
| 530 | - Application application = Application::New( &argc, &argv ); | |
| 528 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 531 | 529 | |
| 532 | 530 | RunTest( application ); |
| 533 | 531 | ... | ... |
examples/cluster/cluster-example.cpp
| ... | ... | @@ -21,6 +21,9 @@ |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | #include <dali/dali.h> |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h> | |
| 25 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 26 | +#include <dali-toolkit/devel-api/shader-effects/carousel-effect.h> | |
| 24 | 27 | |
| 25 | 28 | #include "cluster.h" |
| 26 | 29 | #include "cluster-style.h" |
| ... | ... | @@ -357,8 +360,6 @@ public: |
| 357 | 360 | */ |
| 358 | 361 | void Create(Application& application) |
| 359 | 362 | { |
| 360 | - DemoHelper::RequestThemeChange(); | |
| 361 | - | |
| 362 | 363 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ClusterController::OnKeyEvent); |
| 363 | 364 | |
| 364 | 365 | // The Init signal is received once (only) during the Application lifetime |
| ... | ... | @@ -779,7 +780,7 @@ void RunTest(Application& app) |
| 779 | 780 | // |
| 780 | 781 | int main(int argc, char **argv) |
| 781 | 782 | { |
| 782 | - Application app = Application::New(&argc, &argv); | |
| 783 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 783 | 784 | |
| 784 | 785 | RunTest(app); |
| 785 | 786 | ... | ... |
examples/cluster/cluster-impl.cpp
| ... | ... | @@ -23,7 +23,9 @@ |
| 23 | 23 | #include <cstring> // for strcmp |
| 24 | 24 | #include <dali/public-api/animation/animation.h> |
| 25 | 25 | #include <dali/public-api/object/type-registry.h> |
| 26 | +#include <dali/public-api/object/property-array.h> | |
| 26 | 27 | #include <dali/devel-api/object/type-registry-helper.h> |
| 28 | +#include <dali/devel-api/scripting/scripting.h> | |
| 27 | 29 | #include <dali/integration-api/debug.h> |
| 28 | 30 | |
| 29 | 31 | // INTERNAL INCLUDES |
| ... | ... | @@ -92,7 +94,7 @@ void Cluster::OnInitialize() |
| 92 | 94 | { |
| 93 | 95 | } |
| 94 | 96 | |
| 95 | -void Cluster::OnControlSizeSet( const Vector3& targetSize ) | |
| 97 | +void Cluster::OnSizeSet( const Vector3& targetSize ) | |
| 96 | 98 | { |
| 97 | 99 | mClusterSize = targetSize; |
| 98 | 100 | GetImpl(mClusterStyle).SetClusterSize(targetSize); |
| ... | ... | @@ -475,17 +477,21 @@ void Cluster::UpdateTitle(float duration) |
| 475 | 477 | } |
| 476 | 478 | } |
| 477 | 479 | |
| 478 | -void Cluster::DoExpandAction(const PropertyValueContainer& attributes) | |
| 480 | +void Cluster::DoExpandAction(const Property::Map& attributes) | |
| 479 | 481 | { |
| 480 | - if(attributes.size() >= 1) | |
| 482 | + Property::Value* value = attributes.Find( "indices" ); | |
| 483 | + | |
| 484 | + if( value ) | |
| 481 | 485 | { |
| 482 | - for(PropertyValueConstIter iter = attributes.begin(); iter != attributes.end(); ++iter) | |
| 486 | + if( value->GetType() == Property::ARRAY ) | |
| 483 | 487 | { |
| 484 | - const Property::Value& value = *iter; | |
| 485 | - | |
| 486 | - DALI_ASSERT_ALWAYS(value.GetType() == Property::FLOAT); | |
| 487 | - unsigned int index = value.Get<float>(); | |
| 488 | - ExpandChild( index ); | |
| 488 | + Property::Array array = value->Get<Property::Array>(); | |
| 489 | + for( size_t i = 0; i < array.Size(); i++ ) | |
| 490 | + { | |
| 491 | + Property::Value& item = array[i]; | |
| 492 | + DALI_ASSERT_ALWAYS(item.GetType() == Property::INTEGER); | |
| 493 | + ExpandChild( item.Get<int>() ); | |
| 494 | + } | |
| 489 | 495 | } |
| 490 | 496 | } |
| 491 | 497 | else |
| ... | ... | @@ -494,17 +500,21 @@ void Cluster::DoExpandAction(const PropertyValueContainer& attributes) |
| 494 | 500 | } |
| 495 | 501 | } |
| 496 | 502 | |
| 497 | -void Cluster::DoCollapseAction(const PropertyValueContainer& attributes) | |
| 503 | +void Cluster::DoCollapseAction(const Property::Map& attributes) | |
| 498 | 504 | { |
| 499 | - if(attributes.size() >= 1) | |
| 505 | + Property::Value* value = attributes.Find( "indices" ); | |
| 506 | + | |
| 507 | + if( value ) | |
| 500 | 508 | { |
| 501 | - for(PropertyValueConstIter iter = attributes.begin(); iter != attributes.end(); ++iter) | |
| 509 | + if( value->GetType() == Property::ARRAY ) | |
| 502 | 510 | { |
| 503 | - const Property::Value& value = *iter; | |
| 504 | - | |
| 505 | - DALI_ASSERT_ALWAYS(value.GetType() == Property::FLOAT); | |
| 506 | - unsigned int index = value.Get<float>(); | |
| 507 | - CollapseChild( index, false ); | |
| 511 | + Property::Array array = value->Get<Property::Array>(); | |
| 512 | + for( size_t i = 0; i < array.Size(); i++ ) | |
| 513 | + { | |
| 514 | + Property::Value& item = array[i]; | |
| 515 | + DALI_ASSERT_ALWAYS(item.GetType() == Property::INTEGER); | |
| 516 | + CollapseChild( item.Get<int>(), false ); | |
| 517 | + } | |
| 508 | 518 | } |
| 509 | 519 | } |
| 510 | 520 | else |
| ... | ... | @@ -513,27 +523,33 @@ void Cluster::DoCollapseAction(const PropertyValueContainer& attributes) |
| 513 | 523 | } |
| 514 | 524 | } |
| 515 | 525 | |
| 516 | -void Cluster::DoTransformAction(const PropertyValueContainer& attributes) | |
| 526 | + | |
| 527 | +void Cluster::DoTransformAction(const Property::Map& attributes) | |
| 517 | 528 | { |
| 518 | - DALI_ASSERT_ALWAYS(attributes.size() >= 2); | |
| 529 | + typedef Dali::StringValuePair StringValuePair; | |
| 519 | 530 | |
| 520 | - DALI_ASSERT_ALWAYS(attributes[0].GetType() == Property::FLOAT); | |
| 521 | - unsigned int index = attributes[0].Get<float>(); | |
| 531 | + int index = 0; | |
| 522 | 532 | Vector3 position; |
| 523 | 533 | Vector3 scale(Vector3::ONE); |
| 524 | 534 | Quaternion rotation( Dali::ANGLE_0, Vector3::ZAXIS ); |
| 525 | 535 | |
| 526 | - DALI_ASSERT_ALWAYS(attributes[1].GetType() == Property::VECTOR3); | |
| 527 | - attributes[1].Get(position); | |
| 528 | - | |
| 529 | - if(attributes.size()>2) | |
| 536 | + for(size_t i = 0; i < attributes.Count(); i++) | |
| 530 | 537 | { |
| 531 | - attributes[2].Get(scale); | |
| 532 | - } | |
| 538 | + StringValuePair& stringValue = attributes.GetPair(i); | |
| 539 | + Property::Type type = stringValue.second.GetType(); | |
| 533 | 540 | |
| 534 | - if(attributes.size()>3) | |
| 535 | - { | |
| 536 | - attributes[3].Get(rotation); | |
| 541 | + if( Property::VECTOR3 == type && "position" == stringValue.first ) | |
| 542 | + { | |
| 543 | + stringValue.second.Get(position); | |
| 544 | + } | |
| 545 | + else if( Property::VECTOR3 == type && "scale" == stringValue.first ) | |
| 546 | + { | |
| 547 | + stringValue.second.Get(scale); | |
| 548 | + } | |
| 549 | + else if( "rotation" == stringValue.first ) | |
| 550 | + { | |
| 551 | + (void)Scripting::SetRotation(stringValue.second, rotation); | |
| 552 | + } | |
| 537 | 553 | } |
| 538 | 554 | |
| 539 | 555 | // wrap index around -1 => size - 1 |
| ... | ... | @@ -547,7 +563,7 @@ void Cluster::OnControlChildRemove(Actor& child) |
| 547 | 563 | child.RemoveConstraints(); |
| 548 | 564 | } |
| 549 | 565 | |
| 550 | -bool Cluster::DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes) | |
| 566 | +bool Cluster::DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes) | |
| 551 | 567 | { |
| 552 | 568 | bool ret = false; |
| 553 | 569 | ... | ... |
examples/cluster/cluster-impl.h
| ... | ... | @@ -212,7 +212,7 @@ private: |
| 212 | 212 | * @param[in] attributes list of indices of actors to expand. |
| 213 | 213 | * (if no attributes specifies, then all actors expand) |
| 214 | 214 | */ |
| 215 | - void DoExpandAction(const PropertyValueContainer& attributes); | |
| 215 | + void DoExpandAction(const Property::Map& attributes); | |
| 216 | 216 | |
| 217 | 217 | /** |
| 218 | 218 | * Action: Collapse |
| ... | ... | @@ -221,7 +221,7 @@ private: |
| 221 | 221 | * @param[in] attributes list of indices of actors to collapse. |
| 222 | 222 | * (if no attributes specifies, then all actors collapse) |
| 223 | 223 | */ |
| 224 | - void DoCollapseAction(const PropertyValueContainer& attributes); | |
| 224 | + void DoCollapseAction(const Property::Map& attributes); | |
| 225 | 225 | |
| 226 | 226 | /** |
| 227 | 227 | * Action: Transform |
| ... | ... | @@ -230,7 +230,7 @@ private: |
| 230 | 230 | * |
| 231 | 231 | * @param[in] attributes index and transform values. |
| 232 | 232 | */ |
| 233 | - void DoTransformAction(const PropertyValueContainer& attributes); | |
| 233 | + void DoTransformAction(const Property::Map& attributes); | |
| 234 | 234 | |
| 235 | 235 | private: // From Control |
| 236 | 236 | /** |
| ... | ... | @@ -248,20 +248,20 @@ public: |
| 248 | 248 | * @param[in] attributes The attributes with which to perfrom this action. |
| 249 | 249 | * @return true if action has been accepted by this control |
| 250 | 250 | */ |
| 251 | - static bool DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes); | |
| 251 | + static bool DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes); | |
| 252 | 252 | |
| 253 | 253 | private: // From Control |
| 254 | 254 | |
| 255 | 255 | /** |
| 256 | - * @copydoc Demo::Control::OnInitialize() | |
| 256 | + * @copydoc Control::OnInitialize() | |
| 257 | 257 | */ |
| 258 | 258 | virtual void OnInitialize(); |
| 259 | 259 | |
| 260 | 260 | /** |
| 261 | 261 | * |
| 262 | - * @copydoc Demo::Control::OnControlSizeSet( const Vector3& targetSize ) | |
| 262 | + * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize ) | |
| 263 | 263 | */ |
| 264 | - virtual void OnControlSizeSet( const Vector3& targetSize ); | |
| 264 | + virtual void OnSizeSet( const Vector3& targetSize ); | |
| 265 | 265 | |
| 266 | 266 | protected: |
| 267 | 267 | ... | ... |
examples/cube-transition-effect/cube-transition-effect-example.cpp
| ... | ... | @@ -23,6 +23,11 @@ |
| 23 | 23 | |
| 24 | 24 | #include <dali/dali.h> |
| 25 | 25 | #include <dali-toolkit/dali-toolkit.h> |
| 26 | +#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h> | |
| 27 | +#include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h> | |
| 28 | +#include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h> | |
| 29 | +#include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h> | |
| 30 | + | |
| 26 | 31 | |
| 27 | 32 | using namespace Dali; |
| 28 | 33 | |
| ... | ... | @@ -219,8 +224,6 @@ CubeTransitionApp::~CubeTransitionApp() |
| 219 | 224 | |
| 220 | 225 | void CubeTransitionApp::OnInit( Application& application ) |
| 221 | 226 | { |
| 222 | - DemoHelper::RequestThemeChange(); | |
| 223 | - | |
| 224 | 227 | Stage::GetCurrent().KeyEventSignal().Connect(this, &CubeTransitionApp::OnKeyEvent); |
| 225 | 228 | |
| 226 | 229 | // Creates a default view with a default tool bar, the view is added to the stage. |
| ... | ... | @@ -430,7 +433,7 @@ void CubeTransitionApp::OnKeyEvent(const KeyEvent& event) |
| 430 | 433 | // Entry point for Linux & Tizen applications |
| 431 | 434 | int main( int argc, char **argv ) |
| 432 | 435 | { |
| 433 | - Application application = Application::New( &argc, &argv ); | |
| 436 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 434 | 437 | CubeTransitionApp test( application ); |
| 435 | 438 | application.MainLoop(); |
| 436 | 439 | ... | ... |
examples/dissolve-effect/dissolve-effect-example.cpp
| ... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 | |
| 24 | 24 | #include <dali/dali.h> |
| 25 | 25 | #include <dali-toolkit/dali-toolkit.h> |
| 26 | +#include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h> | |
| 26 | 27 | |
| 27 | 28 | using namespace Dali; |
| 28 | 29 | |
| ... | ... | @@ -203,8 +204,6 @@ DissolveEffectApp::~DissolveEffectApp() |
| 203 | 204 | |
| 204 | 205 | void DissolveEffectApp::OnInit( Application& application ) |
| 205 | 206 | { |
| 206 | - DemoHelper::RequestThemeChange(); | |
| 207 | - | |
| 208 | 207 | Stage::GetCurrent().KeyEventSignal().Connect(this, &DissolveEffectApp::OnKeyEvent); |
| 209 | 208 | |
| 210 | 209 | // Creates a default view with a default tool bar, the view is added to the stage. |
| ... | ... | @@ -429,7 +428,7 @@ bool DissolveEffectApp::OnTimerTick() |
| 429 | 428 | // Entry point for Linux & Tizen applications |
| 430 | 429 | int main( int argc, char **argv ) |
| 431 | 430 | { |
| 432 | - Application application = Application::New( &argc, &argv ); | |
| 431 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 433 | 432 | DissolveEffectApp test( application ); |
| 434 | 433 | application.MainLoop(); |
| 435 | 434 | ... | ... |
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
| ... | ... | @@ -17,6 +17,7 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 20 | 21 | #include "shared/view.h" |
| 21 | 22 | #include <iostream> |
| 22 | 23 | |
| ... | ... | @@ -169,9 +170,6 @@ public: |
| 169 | 170 | // The Init signal is received once (only) during the Application lifetime |
| 170 | 171 | void Create( Application& application ) |
| 171 | 172 | { |
| 172 | - // Apply the default theme: | |
| 173 | - DemoHelper::RequestThemeChange(); | |
| 174 | - | |
| 175 | 173 | // Get a handle to the stage |
| 176 | 174 | Stage stage = Stage::GetCurrent(); |
| 177 | 175 | |
| ... | ... | @@ -730,7 +728,7 @@ void RunTest( Application& application ) |
| 730 | 728 | // Entry point for Linux & Tizen applications |
| 731 | 729 | int main( int argc, char **argv ) |
| 732 | 730 | { |
| 733 | - Application application = Application::New( &argc, &argv ); | |
| 731 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 734 | 732 | |
| 735 | 733 | RunTest( application ); |
| 736 | 734 | ... | ... |
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
| ... | ... | @@ -287,8 +287,6 @@ public: |
| 287 | 287 | { |
| 288 | 288 | std::cout << "ImageScalingIrregularGridController::Create" << std::endl; |
| 289 | 289 | |
| 290 | - DemoHelper::RequestThemeChange(); | |
| 291 | - | |
| 292 | 290 | // Get a handle to the stage: |
| 293 | 291 | Stage stage = Stage::GetCurrent(); |
| 294 | 292 | |
| ... | ... | @@ -611,7 +609,7 @@ void RunTest( Application& application ) |
| 611 | 609 | /** Entry point for Linux & Tizen applications */ |
| 612 | 610 | int main( int argc, char **argv ) |
| 613 | 611 | { |
| 614 | - Application application = Application::New( &argc, &argv ); | |
| 612 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 615 | 613 | |
| 616 | 614 | RunTest( application ); |
| 617 | 615 | ... | ... |
examples/item-view/item-view-example.cpp
| ... | ... | @@ -203,8 +203,6 @@ public: |
| 203 | 203 | */ |
| 204 | 204 | void OnInit(Application& app) |
| 205 | 205 | { |
| 206 | - DemoHelper::RequestThemeChange(); | |
| 207 | - | |
| 208 | 206 | Stage stage = Dali::Stage::GetCurrent(); |
| 209 | 207 | stage.KeyEventSignal().Connect(this, &ItemViewExample::OnKeyEvent); |
| 210 | 208 | |
| ... | ... | @@ -222,7 +220,7 @@ public: |
| 222 | 220 | TOOLBAR_IMAGE, |
| 223 | 221 | "" ); |
| 224 | 222 | |
| 225 | - app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &ItemViewExample::OnOrientationChanged ); | |
| 223 | + //app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &ItemViewExample::OnOrientationChanged ); | |
| 226 | 224 | |
| 227 | 225 | // Create an edit mode button. (left of toolbar) |
| 228 | 226 | Toolkit::PushButton editButton = Toolkit::PushButton::New(); |
| ... | ... | @@ -315,7 +313,7 @@ public: |
| 315 | 313 | mWhiteImage = BufferImage::WHITE(); |
| 316 | 314 | } |
| 317 | 315 | |
| 318 | - Actor OnKeyboardPreFocusChange( Actor current, Actor proposed, Control::KeyboardFocusNavigationDirection direction ) | |
| 316 | + Actor OnKeyboardPreFocusChange( Actor current, Actor proposed, Control::KeyboardFocus::Direction direction ) | |
| 319 | 317 | { |
| 320 | 318 | if ( !current && !proposed ) |
| 321 | 319 | { |
| ... | ... | @@ -991,7 +989,7 @@ void RunTest(Application& app) |
| 991 | 989 | |
| 992 | 990 | int main(int argc, char **argv) |
| 993 | 991 | { |
| 994 | - Application app = Application::New(&argc, &argv); | |
| 992 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 995 | 993 | |
| 996 | 994 | RunTest(app); |
| 997 | 995 | ... | ... |
examples/logging/logging-example.cpp
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | #include "shared/view.h" |
| 19 | 19 | #include <dali/dali.h> |
| 20 | 20 | #include <dali-toolkit/dali-toolkit.h> |
| 21 | -#include <devel-api/adaptor-framework/performance-logger.h> | |
| 21 | +#include <dali/devel-api/adaptor-framework/performance-logger.h> | |
| 22 | 22 | #include <sstream> |
| 23 | 23 | |
| 24 | 24 | using namespace Dali; |
| ... | ... | @@ -144,8 +144,6 @@ class LoggingController: public ConnectionTracker |
| 144 | 144 | { |
| 145 | 145 | // The Init signal is received once (only) during the Application lifetime |
| 146 | 146 | |
| 147 | - DemoHelper::RequestThemeChange(); | |
| 148 | - | |
| 149 | 147 | mCurrentLogger = 0; |
| 150 | 148 | mPerformanceLoggers.reserve( NUM_LOGGERS ); |
| 151 | 149 | mPerformanceLoggers.resize( NUM_LOGGERS ); |
| ... | ... | @@ -755,7 +753,7 @@ void RunTest( Application& application ) |
| 755 | 753 | // |
| 756 | 754 | int main( int argc, char **argv ) |
| 757 | 755 | { |
| 758 | - Application application = Application::New( &argc, &argv ); | |
| 756 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 759 | 757 | |
| 760 | 758 | RunTest( application ); |
| 761 | 759 | ... | ... |
examples/magnifier/magnifier-example.cpp
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | - | |
| 24 | +#include <dali-toolkit/devel-api/controls/magnifier/magnifier.h> | |
| 25 | 25 | using namespace Dali; |
| 26 | 26 | |
| 27 | 27 | namespace |
| ... | ... | @@ -193,8 +193,6 @@ public: |
| 193 | 193 | */ |
| 194 | 194 | void Create( Application& application ) |
| 195 | 195 | { |
| 196 | - DemoHelper::RequestThemeChange(); | |
| 197 | - | |
| 198 | 196 | Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); |
| 199 | 197 | |
| 200 | 198 | mStageSize = Stage::GetCurrent().GetSize(); |
| ... | ... | @@ -415,7 +413,7 @@ void RunTest( Application& application ) |
| 415 | 413 | // |
| 416 | 414 | int main( int argc, char **argv ) |
| 417 | 415 | { |
| 418 | - Application application = Application::New( &argc, &argv ); | |
| 416 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 419 | 417 | |
| 420 | 418 | RunTest( application ); |
| 421 | 419 | ... | ... |
examples/motion-blur/motion-blur-example.cpp
| ... | ... | @@ -21,6 +21,8 @@ |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | #include <dali/dali.h> |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h> | |
| 25 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 24 | 26 | |
| 25 | 27 | using namespace Dali; |
| 26 | 28 | using namespace Dali::Toolkit; |
| ... | ... | @@ -189,8 +191,8 @@ public: |
| 189 | 191 | winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); |
| 190 | 192 | |
| 191 | 193 | // set initial orientation |
| 192 | - winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionBlurExampleApp::OnOrientationChanged ); | |
| 193 | - unsigned int degrees = winHandle.GetOrientation().GetDegrees(); | |
| 194 | + // winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionBlurExampleApp::OnOrientationChanged ); | |
| 195 | + unsigned int degrees = 0; | |
| 194 | 196 | Rotate( static_cast< DeviceOrientation >( degrees ) ); |
| 195 | 197 | |
| 196 | 198 | |
| ... | ... | @@ -564,7 +566,7 @@ void RunTest(Application& app) |
| 564 | 566 | // |
| 565 | 567 | int main(int argc, char **argv) |
| 566 | 568 | { |
| 567 | - Application app = Application::New(&argc, &argv); | |
| 569 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 568 | 570 | |
| 569 | 571 | RunTest(app); |
| 570 | 572 | ... | ... |
examples/motion-stretch/motion-stretch-example.cpp
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | #include <dali/dali.h> |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h> | |
| 24 | 25 | |
| 25 | 26 | using namespace Dali; |
| 26 | 27 | using namespace Dali::Toolkit; |
| ... | ... | @@ -124,8 +125,6 @@ public: |
| 124 | 125 | { |
| 125 | 126 | // The Init signal is received once (only) during the Application lifetime |
| 126 | 127 | |
| 127 | - DemoHelper::RequestThemeChange(); | |
| 128 | - | |
| 129 | 128 | Stage::GetCurrent().KeyEventSignal().Connect(this, &MotionStretchExampleApp::OnKeyEvent); |
| 130 | 129 | |
| 131 | 130 | // Creates a default view with a default tool bar. |
| ... | ... | @@ -166,8 +165,8 @@ public: |
| 166 | 165 | winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE ); |
| 167 | 166 | winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); |
| 168 | 167 | |
| 169 | - winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionStretchExampleApp::OnOrientationChanged ); | |
| 170 | - unsigned int degrees = winHandle.GetOrientation().GetDegrees(); | |
| 168 | + // winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionStretchExampleApp::OnOrientationChanged ); | |
| 169 | + unsigned int degrees = 0; | |
| 171 | 170 | Rotate( static_cast< DeviceOrientation >( degrees ) ); |
| 172 | 171 | |
| 173 | 172 | |
| ... | ... | @@ -446,7 +445,7 @@ void RunTest(Application& app) |
| 446 | 445 | // |
| 447 | 446 | int main(int argc, char **argv) |
| 448 | 447 | { |
| 449 | - Application app = Application::New(&argc, &argv); | |
| 448 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 450 | 449 | |
| 451 | 450 | RunTest(app); |
| 452 | 451 | ... | ... |
examples/new-window/new-window-example.cpp
| ... | ... | @@ -15,6 +15,8 @@ |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | #include <dali-toolkit/dali-toolkit.h> |
| 18 | +#include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h> | |
| 19 | + | |
| 18 | 20 | #include "shared/view.h" |
| 19 | 21 | #include <cstdio> |
| 20 | 22 | #include <iostream> |
| ... | ... | @@ -159,8 +161,6 @@ NewWindowController::NewWindowController( Application& application ) |
| 159 | 161 | |
| 160 | 162 | void NewWindowController::Create( Application& app ) |
| 161 | 163 | { |
| 162 | - DemoHelper::RequestThemeChange(); | |
| 163 | - | |
| 164 | 164 | Stage stage = Stage::GetCurrent(); |
| 165 | 165 | stage.SetBackgroundColor(Color::YELLOW); |
| 166 | 166 | |
| ... | ... | @@ -540,7 +540,7 @@ void RunTest(Application& app) |
| 540 | 540 | // |
| 541 | 541 | int main(int argc, char **argv) |
| 542 | 542 | { |
| 543 | - gApplication = Application::New(&argc, &argv); | |
| 543 | + gApplication = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 544 | 544 | RunTest(gApplication); |
| 545 | 545 | |
| 546 | 546 | return 0; | ... | ... |
examples/page-turn-view/page-turn-view-example.cpp
| ... | ... | @@ -17,6 +17,11 @@ |
| 17 | 17 | |
| 18 | 18 | #include <dali/dali.h> |
| 19 | 19 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | +#include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h> | |
| 21 | +#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h> | |
| 22 | +#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h> | |
| 23 | +#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h> | |
| 24 | + | |
| 20 | 25 | #include <assert.h> |
| 21 | 26 | #include <cstdlib> |
| 22 | 27 | #include <string.h> |
| ... | ... | @@ -221,8 +226,6 @@ void PageTurnController::OnInit( Application& app ) |
| 221 | 226 | { |
| 222 | 227 | // The Init signal is received once ( only ) during the Application lifetime |
| 223 | 228 | |
| 224 | - DemoHelper::RequestThemeChange(); | |
| 225 | - | |
| 226 | 229 | Stage::GetCurrent().KeyEventSignal().Connect(this, &PageTurnController::OnKeyEvent); |
| 227 | 230 | |
| 228 | 231 | Stage stage = Stage::GetCurrent(); |
| ... | ... | @@ -242,7 +245,7 @@ void PageTurnController::OnInit( Application& app ) |
| 242 | 245 | winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); |
| 243 | 246 | |
| 244 | 247 | // view will response to orientation change to display portrait or landscape views |
| 245 | - app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &PageTurnController::OnOrientationAnimationStarted ); | |
| 248 | + //app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &PageTurnController::OnOrientationAnimationStarted ); | |
| 246 | 249 | |
| 247 | 250 | mPageTurnPortraitView = PageTurnPortraitView::New( mPortraitPageFactory, stageSize ); |
| 248 | 251 | mPageTurnPortraitView.SetSpineShadowParameter( Vector2(70.f, 30.f) ); |
| ... | ... | @@ -342,7 +345,7 @@ void PageTurnController::OnPageFinishedPan( PageTurnView pageTurnView ) |
| 342 | 345 | // Entry point for applications |
| 343 | 346 | int main( int argc, char **argv ) |
| 344 | 347 | { |
| 345 | - Application app = Application::New(&argc, &argv); | |
| 348 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 346 | 349 | PageTurnController test ( app ); |
| 347 | 350 | |
| 348 | 351 | app.MainLoop(); | ... | ... |
examples/radial-menu/radial-menu-example.cpp
| ... | ... | @@ -130,8 +130,6 @@ RadialMenuExample::~RadialMenuExample() |
| 130 | 130 | |
| 131 | 131 | void RadialMenuExample::OnInit(Application& app) |
| 132 | 132 | { |
| 133 | - DemoHelper::RequestThemeChange(); | |
| 134 | - | |
| 135 | 133 | Stage stage = Dali::Stage::GetCurrent(); |
| 136 | 134 | |
| 137 | 135 | // The Init signal is received once (only) during the Application lifetime |
| ... | ... | @@ -300,7 +298,7 @@ void RunTest(Application app) |
| 300 | 298 | // Entry point for Linux & Tizen applications |
| 301 | 299 | int main(int argc, char **argv) |
| 302 | 300 | { |
| 303 | - Application app = Application::New(&argc, &argv); | |
| 301 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 304 | 302 | |
| 305 | 303 | RunTest(app); |
| 306 | 304 | ... | ... |
examples/refraction-effect/refraction-effect-example.cpp
| ... | ... | @@ -233,8 +233,6 @@ private: |
| 233 | 233 | // The Init signal is received once (only) during the Application lifetime |
| 234 | 234 | void Create(Application& application) |
| 235 | 235 | { |
| 236 | - DemoHelper::RequestThemeChange(); | |
| 237 | - | |
| 238 | 236 | Stage stage = Stage::GetCurrent(); |
| 239 | 237 | Vector2 stageSize = stage.GetSize(); |
| 240 | 238 | |
| ... | ... | @@ -601,7 +599,7 @@ RunTest(Application& app) |
| 601 | 599 | int |
| 602 | 600 | main(int argc, char **argv) |
| 603 | 601 | { |
| 604 | - Application app = Application::New(&argc, &argv); | |
| 602 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 605 | 603 | |
| 606 | 604 | RunTest(app); |
| 607 | 605 | ... | ... |
examples/scripting/launcher.cpp
| ... | ... | @@ -48,7 +48,6 @@ Launcher::Launcher( Dali::Application application, std::string layoutFileName, s |
| 48 | 48 | mJSONFileName(layoutFileName ), |
| 49 | 49 | mJavaScriptFileName( scriptFileName ) |
| 50 | 50 | { |
| 51 | - | |
| 52 | 51 | mApplication.InitSignal().Connect( this, &Launcher::Create ); |
| 53 | 52 | } |
| 54 | 53 | |
| ... | ... | @@ -58,8 +57,6 @@ Launcher::~Launcher() |
| 58 | 57 | |
| 59 | 58 | void Launcher::Create( Dali::Application& application ) |
| 60 | 59 | { |
| 61 | - DemoHelper::RequestThemeChange(); | |
| 62 | - | |
| 63 | 60 | TextLabel textActor = TextLabel::New( "JSON & JavaScript Launcher..." ); |
| 64 | 61 | |
| 65 | 62 | // Reposition the actor | ... | ... |
examples/scripting/launcher.h
| ... | ... | @@ -21,6 +21,8 @@ |
| 21 | 21 | // EXTERNAL INCLUDES |
| 22 | 22 | #include <dali/dali.h> |
| 23 | 23 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | +#include <dali-toolkit/devel-api/scripting/script.h> | |
| 25 | +#include <dali-toolkit/devel-api/builder/builder.h> | |
| 24 | 26 | |
| 25 | 27 | /** |
| 26 | 28 | * Example app that can load both JSON and JavaScript files from command line | ... | ... |
examples/scripting/scripting-example.cpp
| ... | ... | @@ -88,7 +88,7 @@ int main( int argc, char* argv[] ) |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| 91 | - Launcher daliApplication( Dali::Application::New( &argc, &argv ), jSONFileName, javaScriptFileName ); | |
| 91 | + Launcher daliApplication( Dali::Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ), jSONFileName, javaScriptFileName ); | |
| 92 | 92 | |
| 93 | 93 | daliApplication.MainLoop(); |
| 94 | 94 | ... | ... |
examples/scroll-view/scroll-view-example.cpp
| ... | ... | @@ -157,8 +157,6 @@ public: |
| 157 | 157 | */ |
| 158 | 158 | void OnInit(Application& app) |
| 159 | 159 | { |
| 160 | - DemoHelper::RequestThemeChange(); | |
| 161 | - | |
| 162 | 160 | Stage stage = Dali::Stage::GetCurrent(); |
| 163 | 161 | stage.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); |
| 164 | 162 | |
| ... | ... | @@ -584,7 +582,7 @@ private: |
| 584 | 582 | |
| 585 | 583 | int main(int argc, char **argv) |
| 586 | 584 | { |
| 587 | - Application app = Application::New(&argc, &argv); | |
| 585 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 588 | 586 | ExampleController test(app); |
| 589 | 587 | app.MainLoop(); |
| 590 | 588 | return 0; | ... | ... |
examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp
| ... | ... | @@ -20,6 +20,8 @@ |
| 20 | 20 | |
| 21 | 21 | #include <dali/dali.h> |
| 22 | 22 | #include <dali-toolkit/dali-toolkit.h> |
| 23 | +#include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h> | |
| 24 | + | |
| 23 | 25 | #include <iostream> |
| 24 | 26 | |
| 25 | 27 | using namespace Dali; |
| ... | ... | @@ -120,8 +122,6 @@ public: |
| 120 | 122 | */ |
| 121 | 123 | void Create(Application& app) |
| 122 | 124 | { |
| 123 | - DemoHelper::RequestThemeChange(); | |
| 124 | - | |
| 125 | 125 | srand(0); // Want repeatable path |
| 126 | 126 | |
| 127 | 127 | Stage::GetCurrent().KeyEventSignal().Connect(this, &TestApp::OnKeyEvent); |
| ... | ... | @@ -501,7 +501,7 @@ RunTest(Application& app) |
| 501 | 501 | int |
| 502 | 502 | main(int argc, char **argv) |
| 503 | 503 | { |
| 504 | - Application app = Application::New(&argc, &argv); | |
| 504 | + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); | |
| 505 | 505 | |
| 506 | 506 | RunTest(app); |
| 507 | 507 | ... | ... |
examples/size-negotiation/size-negotiation-example.cpp
| ... | ... | @@ -18,6 +18,7 @@ |
| 18 | 18 | #include "shared/view.h" |
| 19 | 19 | #include <dali/dali.h> |
| 20 | 20 | #include <dali-toolkit/dali-toolkit.h> |
| 21 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 21 | 22 | |
| 22 | 23 | using namespace Dali; |
| 23 | 24 | |
| ... | ... | @@ -157,8 +158,6 @@ public: |
| 157 | 158 | { |
| 158 | 159 | // The Init signal is received once (only) during the Application lifetime |
| 159 | 160 | |
| 160 | - DemoHelper::RequestThemeChange(); | |
| 161 | - | |
| 162 | 161 | Stage stage = Stage::GetCurrent(); |
| 163 | 162 | |
| 164 | 163 | // Respond to key events |
| ... | ... | @@ -1298,7 +1297,7 @@ void RunTest( Application& application ) |
| 1298 | 1297 | // |
| 1299 | 1298 | int main( int argc, char **argv ) |
| 1300 | 1299 | { |
| 1301 | - Application application = Application::New( &argc, &argv ); | |
| 1300 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 1302 | 1301 | |
| 1303 | 1302 | RunTest( application ); |
| 1304 | 1303 | ... | ... |
examples/text-field/text-field-example.cpp
| ... | ... | @@ -22,7 +22,9 @@ |
| 22 | 22 | |
| 23 | 23 | // EXTERNAL INCLUDES |
| 24 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 25 | +#include <dali-toolkit/devel-api/controls/popup/popup.h> | |
| 25 | 26 | #include <iostream> |
| 27 | +#include <dali/public-api/events/touch-point.h> | |
| 26 | 28 | |
| 27 | 29 | // INTERNAL INCLUDES |
| 28 | 30 | #include "shared/multi-language-strings.h" |
| ... | ... | @@ -35,38 +37,11 @@ using namespace MultiLanguageStrings; |
| 35 | 37 | namespace |
| 36 | 38 | { |
| 37 | 39 | |
| 38 | - const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; | |
| 40 | + const char* const FOLDER_ICON_IMAGE = DALI_IMAGE_DIR "folder_appicon_empty_bg.png"; | |
| 39 | 41 | |
| 40 | 42 | const float BORDER_WIDTH = 4.0f; |
| 41 | 43 | |
| 42 | - const unsigned int KEY_ZERO = 10; | |
| 43 | - const unsigned int KEY_ONE = 11; | |
| 44 | - const unsigned int KEY_F = 41; | |
| 45 | - const unsigned int KEY_H = 43; | |
| 46 | - const unsigned int KEY_V = 55; | |
| 47 | - const unsigned int KEY_M = 58; | |
| 48 | - const unsigned int KEY_L = 46; | |
| 49 | - const unsigned int KEY_S = 39; | |
| 50 | - const unsigned int KEY_PLUS = 21; | |
| 51 | - const unsigned int KEY_MINUS = 20; | |
| 52 | - | |
| 53 | - const char* H_ALIGNMENT_STRING_TABLE[] = | |
| 54 | - { | |
| 55 | - "BEGIN", | |
| 56 | - "CENTER", | |
| 57 | - "END" | |
| 58 | - }; | |
| 59 | - | |
| 60 | - const unsigned int H_ALIGNMENT_STRING_COUNT = sizeof( H_ALIGNMENT_STRING_TABLE ) / sizeof( H_ALIGNMENT_STRING_TABLE[0u] ); | |
| 61 | - | |
| 62 | - const char* V_ALIGNMENT_STRING_TABLE[] = | |
| 63 | - { | |
| 64 | - "TOP", | |
| 65 | - "CENTER", | |
| 66 | - "BOTTOM" | |
| 67 | - }; | |
| 68 | - | |
| 69 | - const unsigned int V_ALIGNMENT_STRING_COUNT = sizeof( V_ALIGNMENT_STRING_TABLE ) / sizeof( V_ALIGNMENT_STRING_TABLE[0u] ); | |
| 44 | + const Vector3 POPUP_SIZE_FACTOR_TO_PARENT = Vector3( 0.0, 0.25, 0.0 ); | |
| 70 | 45 | |
| 71 | 46 | } // unnamed namespace |
| 72 | 47 | |
| ... | ... | @@ -78,9 +53,7 @@ class TextFieldExample : public ConnectionTracker |
| 78 | 53 | public: |
| 79 | 54 | |
| 80 | 55 | TextFieldExample( Application& application ) |
| 81 | - : mApplication( application ), | |
| 82 | - mLanguageId( 0u ), | |
| 83 | - mAlignment( 0u ) | |
| 56 | + : mApplication( application ) | |
| 84 | 57 | { |
| 85 | 58 | // Connect to the Application's Init signal |
| 86 | 59 | mApplication.InitSignal().Connect( this, &TextFieldExample::Create ); |
| ... | ... | @@ -96,44 +69,121 @@ public: |
| 96 | 69 | */ |
| 97 | 70 | void Create( Application& application ) |
| 98 | 71 | { |
| 99 | - DemoHelper::RequestThemeChange(); | |
| 100 | - | |
| 101 | 72 | Stage stage = Stage::GetCurrent(); |
| 102 | 73 | |
| 103 | - mTapGestureDetector = TapGestureDetector::New(); | |
| 104 | - mTapGestureDetector.Attach( stage.GetRootLayer() ); | |
| 105 | - mTapGestureDetector.DetectedSignal().Connect( this, &TextFieldExample::OnTap ); | |
| 106 | - | |
| 74 | + stage.SetBackgroundColor( Vector4( 0.04f, 0.345f, 0.392f, 1.0f ) ); | |
| 107 | 75 | stage.KeyEventSignal().Connect(this, &TextFieldExample::OnKeyEvent); |
| 108 | 76 | |
| 77 | + mButton = CreateFolderButton(); | |
| 78 | + mButton.ClickedSignal().Connect( this, &TextFieldExample::OnButtonClicked ); | |
| 79 | + stage.Add( mButton ); | |
| 80 | + } | |
| 81 | + | |
| 82 | + PushButton CreateFolderButton() | |
| 83 | + { | |
| 84 | + PushButton button = PushButton::New(); | |
| 85 | + ResourceImage image = ResourceImage::New( FOLDER_ICON_IMAGE ); | |
| 86 | + ImageActor folderButton = ImageActor::New( image ); | |
| 87 | + folderButton.SetColor( Color::WHITE ); | |
| 88 | + button.SetButtonImage( folderButton ); | |
| 89 | + button.SetAnchorPoint( AnchorPoint::TOP_LEFT ); | |
| 90 | + button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); | |
| 91 | + button.SetSize( image.GetWidth(), image.GetHeight() ); | |
| 92 | + | |
| 93 | + return button; | |
| 94 | + } | |
| 95 | + | |
| 96 | + bool OnButtonClicked( Toolkit::Button button ) | |
| 97 | + { | |
| 98 | + Stage stage = Stage::GetCurrent(); | |
| 109 | 99 | Vector2 stageSize = stage.GetSize(); |
| 110 | 100 | |
| 111 | - Control container = Control::New(); | |
| 112 | - container.SetName( "Container" ); | |
| 113 | - container.SetParentOrigin( ParentOrigin::CENTER ); | |
| 114 | - container.SetSize( Vector2(stageSize.width*0.6f, stageSize.width*0.6f) ); | |
| 115 | - container.SetBackgroundColor( Color::WHITE ); | |
| 116 | - container.GetChildAt(0).SetZ(-1.0f); | |
| 117 | - stage.Add( container ); | |
| 101 | + // Launch a pop-up containing TextField | |
| 102 | + mField = CreateTextField( stageSize, mButtonLabel ); | |
| 103 | + mPopup = CreatePopup( stageSize.width * 0.8f ); | |
| 104 | + mPopup.Add( mField ); | |
| 105 | + mPopup.OutsideTouchedSignal().Connect( this, &TextFieldExample::OnPopupOutsideTouched ); | |
| 106 | + mPopup.Show(); | |
| 107 | + | |
| 108 | + return true; | |
| 109 | + } | |
| 118 | 110 | |
| 119 | - mField = TextField::New(); | |
| 120 | - mField.SetAnchorPoint( AnchorPoint::TOP_LEFT ); | |
| 121 | - mField.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); | |
| 122 | - mField.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); | |
| 123 | - mField.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "Unnamed folder" ); | |
| 124 | - mField.SetProperty( TextField::Property::PLACEHOLDER_TEXT_FOCUSED, "Enter folder name." ); | |
| 125 | - mField.SetProperty( TextField::Property::DECORATION_BOUNDING_BOX, Rect<int>( BORDER_WIDTH, BORDER_WIDTH, stageSize.width - BORDER_WIDTH*2, stageSize.height - BORDER_WIDTH*2 ) ); | |
| 111 | + TextField CreateTextField( const Vector2& stageSize, const std::string& text ) | |
| 112 | + { | |
| 113 | + TextField field = TextField::New(); | |
| 114 | + field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); | |
| 115 | + field.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); | |
| 116 | + field.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); | |
| 117 | + field.SetProperty( TextField::Property::TEXT, text ); | |
| 118 | + field.SetProperty( TextField::Property::TEXT_COLOR, Vector4( 0.0f, 1.0f, 1.0f, 1.0f ) ); // CYAN | |
| 119 | + field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "Unnamed folder" ); | |
| 120 | + field.SetProperty( TextField::Property::PLACEHOLDER_TEXT_FOCUSED, "Enter folder name." ); | |
| 121 | + field.SetProperty( TextField::Property::DECORATION_BOUNDING_BOX, Rect<int>( BORDER_WIDTH, BORDER_WIDTH, stageSize.width - BORDER_WIDTH*2, stageSize.height - BORDER_WIDTH*2 ) ); | |
| 122 | + | |
| 123 | + return field; | |
| 124 | + } | |
| 126 | 125 | |
| 127 | - container.Add( mField ); | |
| 126 | + Popup CreatePopup( float width ) | |
| 127 | + { | |
| 128 | + Popup popup = Popup::New(); | |
| 129 | + popup.SetParentOrigin( ParentOrigin::CENTER ); | |
| 130 | + popup.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 131 | + popup.SetSize( width, 0.0f ); | |
| 132 | + popup.HideTail(); | |
| 133 | + popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT ); | |
| 134 | + popup.SetSizeModeFactor( POPUP_SIZE_FACTOR_TO_PARENT ); | |
| 135 | + popup.TouchedSignal().Connect( this, &TextFieldExample::OnPopupTouched ); | |
| 136 | + | |
| 137 | + return popup; | |
| 138 | + } | |
| 128 | 139 | |
| 129 | - Property::Value fieldText = mField.GetProperty( TextField::Property::TEXT ); | |
| 140 | + void OnPopupOutsideTouched() | |
| 141 | + { | |
| 142 | + // Update the folder text | |
| 143 | + if( mButton && mField ) | |
| 144 | + { | |
| 145 | + Property::Value text = mField.GetProperty( TextField::Property::TEXT ); | |
| 146 | + mButtonLabel = text.Get< std::string >(); | |
| 147 | + mButton.SetLabel( mButtonLabel ); | |
| 148 | + } | |
| 130 | 149 | |
| 131 | - std::cout << "Displaying text: " << fieldText.Get< std::string >() << std::endl; | |
| 150 | + // Hide & discard the pop-up | |
| 151 | + if( mPopup ) | |
| 152 | + { | |
| 153 | + mPopup.Hide(); | |
| 154 | + } | |
| 155 | + mField.Reset(); | |
| 156 | + mPopup.Reset(); | |
| 132 | 157 | } |
| 133 | 158 | |
| 134 | - void OnTap( Actor actor, const TapGesture& tapGesture ) | |
| 159 | + bool OnPopupTouched( Actor actor, const TouchEvent& event ) | |
| 135 | 160 | { |
| 136 | - mField.ClearKeyInputFocus(); | |
| 161 | + // End edit mode for TextField if parent Popup touched. | |
| 162 | + if(event.GetPointCount() > 0) | |
| 163 | + { | |
| 164 | + const TouchPoint& point = event.GetPoint(0); | |
| 165 | + switch(point.state) | |
| 166 | + { | |
| 167 | + case TouchPoint::Down: | |
| 168 | + { | |
| 169 | + // Update the folder text and lose focus for Key events | |
| 170 | + if( mButton && mField ) | |
| 171 | + { | |
| 172 | + Property::Value text = mField.GetProperty( TextField::Property::TEXT ); | |
| 173 | + mButtonLabel = text.Get< std::string >(); | |
| 174 | + mButton.SetLabel( mButtonLabel ); | |
| 175 | + mField.ClearKeyInputFocus(); | |
| 176 | + } | |
| 177 | + break; | |
| 178 | + } | |
| 179 | + default: | |
| 180 | + { | |
| 181 | + break; | |
| 182 | + } | |
| 183 | + } // end switch | |
| 184 | + } | |
| 185 | + | |
| 186 | + return true; | |
| 137 | 187 | } |
| 138 | 188 | |
| 139 | 189 | /** |
| ... | ... | @@ -147,73 +197,6 @@ public: |
| 147 | 197 | { |
| 148 | 198 | mApplication.Quit(); |
| 149 | 199 | } |
| 150 | - else if( event.IsCtrlModifier() ) | |
| 151 | - { | |
| 152 | - switch( event.keyCode ) | |
| 153 | - { | |
| 154 | - // Select rendering back-end | |
| 155 | - case KEY_ZERO: // fall through | |
| 156 | - case KEY_ONE: | |
| 157 | - { | |
| 158 | - mField.SetProperty( TextField::Property::RENDERING_BACKEND, event.keyCode - 10 ); | |
| 159 | - break; | |
| 160 | - } | |
| 161 | - case KEY_H: // Horizontal alignment | |
| 162 | - { | |
| 163 | - if( ++mAlignment >= H_ALIGNMENT_STRING_COUNT ) | |
| 164 | - { | |
| 165 | - mAlignment = 0u; | |
| 166 | - } | |
| 167 | - | |
| 168 | - mField.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, H_ALIGNMENT_STRING_TABLE[ mAlignment ] ); | |
| 169 | - break; | |
| 170 | - } | |
| 171 | - case KEY_V: // Vertical alignment | |
| 172 | - { | |
| 173 | - if( ++mAlignment >= V_ALIGNMENT_STRING_COUNT ) | |
| 174 | - { | |
| 175 | - mAlignment = 0u; | |
| 176 | - } | |
| 177 | - | |
| 178 | - mField.SetProperty( TextField::Property::VERTICAL_ALIGNMENT, V_ALIGNMENT_STRING_TABLE[ mAlignment ] ); | |
| 179 | - break; | |
| 180 | - } | |
| 181 | - case KEY_L: // Language | |
| 182 | - { | |
| 183 | - const Language& language = LANGUAGES[ mLanguageId ]; | |
| 184 | - | |
| 185 | - mField.SetProperty( TextField::Property::TEXT, language.text ); | |
| 186 | - | |
| 187 | - if( ++mLanguageId >= NUMBER_OF_LANGUAGES ) | |
| 188 | - { | |
| 189 | - mLanguageId = 0u; | |
| 190 | - } | |
| 191 | - break; | |
| 192 | - } | |
| 193 | - case KEY_S: // Shadow color | |
| 194 | - { | |
| 195 | - if( Color::BLACK == mField.GetProperty<Vector4>( TextField::Property::SHADOW_COLOR ) ) | |
| 196 | - { | |
| 197 | - mField.SetProperty( TextField::Property::SHADOW_COLOR, Color::RED ); | |
| 198 | - } | |
| 199 | - else | |
| 200 | - { | |
| 201 | - mField.SetProperty( TextField::Property::SHADOW_COLOR, Color::BLACK ); | |
| 202 | - } | |
| 203 | - break; | |
| 204 | - } | |
| 205 | - case KEY_PLUS: // Increase shadow offset | |
| 206 | - { | |
| 207 | - mField.SetProperty( TextField::Property::SHADOW_OFFSET, mField.GetProperty<Vector2>( TextField::Property::SHADOW_OFFSET ) + Vector2( 1.0f, 1.0f ) ); | |
| 208 | - break; | |
| 209 | - } | |
| 210 | - case KEY_MINUS: // Decrease shadow offset | |
| 211 | - { | |
| 212 | - mField.SetProperty( TextField::Property::SHADOW_OFFSET, mField.GetProperty<Vector2>( TextField::Property::SHADOW_OFFSET ) - Vector2( 1.0f, 1.0f ) ); | |
| 213 | - break; | |
| 214 | - } | |
| 215 | - } | |
| 216 | - } | |
| 217 | 200 | } |
| 218 | 201 | } |
| 219 | 202 | |
| ... | ... | @@ -221,12 +204,13 @@ private: |
| 221 | 204 | |
| 222 | 205 | Application& mApplication; |
| 223 | 206 | |
| 224 | - TextField mField; | |
| 225 | - | |
| 226 | - TapGestureDetector mTapGestureDetector; | |
| 207 | + // This button launches a pop-up containing TextField | |
| 208 | + PushButton mButton; | |
| 209 | + std::string mButtonLabel; | |
| 227 | 210 | |
| 228 | - unsigned int mLanguageId; | |
| 229 | - unsigned int mAlignment; | |
| 211 | + // Pop-up contents | |
| 212 | + TextField mField; | |
| 213 | + Popup mPopup; | |
| 230 | 214 | }; |
| 231 | 215 | |
| 232 | 216 | void RunTest( Application& application ) |
| ... | ... | @@ -239,7 +223,7 @@ void RunTest( Application& application ) |
| 239 | 223 | /** Entry point for Linux & Tizen applications */ |
| 240 | 224 | int main( int argc, char **argv ) |
| 241 | 225 | { |
| 242 | - Application application = Application::New( &argc, &argv ); | |
| 226 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 243 | 227 | |
| 244 | 228 | RunTest( application ); |
| 245 | 229 | ... | ... |
examples/text-label-emojis/text-label-emojis.cpp
| ... | ... | @@ -142,7 +142,7 @@ void RunTest( Application& application ) |
| 142 | 142 | // |
| 143 | 143 | int main( int argc, char **argv ) |
| 144 | 144 | { |
| 145 | - Application application = Application::New( &argc, &argv ); | |
| 145 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 146 | 146 | |
| 147 | 147 | RunTest( application ); |
| 148 | 148 | ... | ... |
examples/text-label-multi-language/text-label-multi-language-example.cpp
| ... | ... | @@ -56,8 +56,6 @@ public: |
| 56 | 56 | */ |
| 57 | 57 | void Create( Application& application ) |
| 58 | 58 | { |
| 59 | - DemoHelper::RequestThemeChange(); | |
| 60 | - | |
| 61 | 59 | Stage stage = Stage::GetCurrent(); |
| 62 | 60 | |
| 63 | 61 | stage.KeyEventSignal().Connect(this, &TextLabelMultiLanguageExample::OnKeyEvent); |
| ... | ... | @@ -146,7 +144,7 @@ void RunTest( Application& application ) |
| 146 | 144 | /** Entry point for Linux & Tizen applications */ |
| 147 | 145 | int main( int argc, char **argv ) |
| 148 | 146 | { |
| 149 | - Application application = Application::New( &argc, &argv ); | |
| 147 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 150 | 148 | |
| 151 | 149 | RunTest( application ); |
| 152 | 150 | ... | ... |
examples/text-label/text-label-example.cpp
| ... | ... | @@ -34,7 +34,7 @@ using namespace MultiLanguageStrings; |
| 34 | 34 | |
| 35 | 35 | namespace |
| 36 | 36 | { |
| 37 | - const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; | |
| 37 | + const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "grab-handle.png"; | |
| 38 | 38 | |
| 39 | 39 | const unsigned int KEY_ZERO = 10; |
| 40 | 40 | const unsigned int KEY_ONE = 11; |
| ... | ... | @@ -97,8 +97,6 @@ public: |
| 97 | 97 | */ |
| 98 | 98 | void Create( Application& application ) |
| 99 | 99 | { |
| 100 | - DemoHelper::RequestThemeChange(); | |
| 101 | - | |
| 102 | 100 | Stage stage = Stage::GetCurrent(); |
| 103 | 101 | |
| 104 | 102 | stage.KeyEventSignal().Connect(this, &TextLabelExample::OnKeyEvent); |
| ... | ... | @@ -109,16 +107,16 @@ public: |
| 109 | 107 | mContainer.SetParentOrigin( ParentOrigin::CENTER ); |
| 110 | 108 | mLayoutSize = Vector2(stageSize.width*0.6f, stageSize.width*0.6f); |
| 111 | 109 | mContainer.SetSize( mLayoutSize ); |
| 110 | + mContainer.SetDrawMode( DrawMode::OVERLAY ); | |
| 112 | 111 | stage.Add( mContainer ); |
| 113 | 112 | |
| 114 | 113 | // Resize the center layout when the corner is grabbed |
| 115 | 114 | mGrabCorner = Control::New(); |
| 116 | 115 | mGrabCorner.SetName( "GrabCorner" ); |
| 117 | - mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); | |
| 116 | + mGrabCorner.SetAnchorPoint( AnchorPoint::TOP_CENTER ); | |
| 118 | 117 | mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); |
| 119 | - mGrabCorner.SetSize( Vector2(stageSize.width*0.1f, stageSize.width*0.1f) ); | |
| 120 | - mGrabCorner.SetZ(1.0f); | |
| 121 | - mGrabCorner.SetBackgroundColor( Color::YELLOW ); | |
| 118 | + mGrabCorner.SetBackgroundImage( ResourceImage::New( BACKGROUND_IMAGE ) ); | |
| 119 | + mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); | |
| 122 | 120 | mContainer.Add( mGrabCorner ); |
| 123 | 121 | |
| 124 | 122 | mPanGestureDetector = PanGestureDetector::New(); |
| ... | ... | @@ -285,7 +283,7 @@ void RunTest( Application& application ) |
| 285 | 283 | /** Entry point for Linux & Tizen applications */ |
| 286 | 284 | int main( int argc, char **argv ) |
| 287 | 285 | { |
| 288 | - Application application = Application::New( &argc, &argv ); | |
| 286 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 289 | 287 | |
| 290 | 288 | RunTest( application ); |
| 291 | 289 | ... | ... |
examples/text-message-field/text-message-field-example.cpp
| ... | ... | @@ -158,7 +158,7 @@ void RunTest( Application& application ) |
| 158 | 158 | /** Entry point for Linux & Tizen applications */ |
| 159 | 159 | int main( int argc, char **argv ) |
| 160 | 160 | { |
| 161 | - Application application = Application::New( &argc, &argv ); | |
| 161 | + Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH ); | |
| 162 | 162 | |
| 163 | 163 | RunTest( application ); |
| 164 | 164 | ... | ... |
packaging/com.samsung.dali-demo.spec
resources/images/folder_appicon_empty_bg.png
0 โ 100644
6.09 KB
resources/images/grab-handle.png
0 โ 100644
5.02 KB
resources/scripts/animated-colors.json
| ... | ... | @@ -18,12 +18,10 @@ |
| 18 | 18 | "stage": [ |
| 19 | 19 | { |
| 20 | 20 | "type": "Control", |
| 21 | - "relayout-enabled": false, | |
| 21 | + "draw-mode": "OVERLAY", | |
| 22 | 22 | "actors": [ |
| 23 | 23 | { |
| 24 | 24 | "type": "Control", |
| 25 | - "relayout-enabled": true, | |
| 26 | - "actors": [], | |
| 27 | 25 | "name": "Control 8", |
| 28 | 26 | "position": [ |
| 29 | 27 | 0, |
| ... | ... | @@ -62,12 +60,9 @@ |
| 62 | 60 | }, |
| 63 | 61 | { |
| 64 | 62 | "type": "Control", |
| 65 | - "relayout-enabled": false, | |
| 66 | 63 | "actors": [ |
| 67 | 64 | { |
| 68 | 65 | "type": "Control", |
| 69 | - "relayout-enabled": false, | |
| 70 | - "actors": [], | |
| 71 | 66 | "name": "Container 2", |
| 72 | 67 | "position": [ |
| 73 | 68 | 0, |
| ... | ... | @@ -106,12 +101,9 @@ |
| 106 | 101 | }, |
| 107 | 102 | { |
| 108 | 103 | "type": "Control", |
| 109 | - "relayout-enabled": false, | |
| 110 | 104 | "actors": [ |
| 111 | 105 | { |
| 112 | 106 | "type": "Control", |
| 113 | - "relayout-enabled": false, | |
| 114 | - "actors": [], | |
| 115 | 107 | "name": "Container 4", |
| 116 | 108 | "position": [ |
| 117 | 109 | 0, |
| ... | ... | @@ -187,12 +179,9 @@ |
| 187 | 179 | }, |
| 188 | 180 | { |
| 189 | 181 | "type": "Control", |
| 190 | - "relayout-enabled": false, | |
| 191 | 182 | "actors": [ |
| 192 | 183 | { |
| 193 | 184 | "type": "Control", |
| 194 | - "relayout-enabled": false, | |
| 195 | - "actors": [], | |
| 196 | 185 | "name": "Container 5", |
| 197 | 186 | "position": [ |
| 198 | 187 | 0, |
| ... | ... | @@ -231,12 +220,9 @@ |
| 231 | 220 | }, |
| 232 | 221 | { |
| 233 | 222 | "type": "Control", |
| 234 | - "relayout-enabled": false, | |
| 235 | 223 | "actors": [ |
| 236 | 224 | { |
| 237 | 225 | "type": "Control", |
| 238 | - "relayout-enabled": false, | |
| 239 | - "actors": [], | |
| 240 | 226 | "name": "Container 7", |
| 241 | 227 | "position": [ |
| 242 | 228 | 0, |
| ... | ... | @@ -312,12 +298,9 @@ |
| 312 | 298 | }, |
| 313 | 299 | { |
| 314 | 300 | "type": "Control", |
| 315 | - "relayout-enabled": false, | |
| 316 | 301 | "actors": [ |
| 317 | 302 | { |
| 318 | 303 | "type": "Control", |
| 319 | - "relayout-enabled": false, | |
| 320 | - "actors": [], | |
| 321 | 304 | "name": "Container 8", |
| 322 | 305 | "position": [ |
| 323 | 306 | 0, |
| ... | ... | @@ -356,12 +339,9 @@ |
| 356 | 339 | }, |
| 357 | 340 | { |
| 358 | 341 | "type": "Control", |
| 359 | - "relayout-enabled": false, | |
| 360 | 342 | "actors": [ |
| 361 | 343 | { |
| 362 | 344 | "type": "Control", |
| 363 | - "relayout-enabled": false, | |
| 364 | - "actors": [], | |
| 365 | 345 | "name": "Container 10", |
| 366 | 346 | "position": [ |
| 367 | 347 | 0, |
| ... | ... | @@ -548,12 +528,9 @@ |
| 548 | 528 | }, |
| 549 | 529 | { |
| 550 | 530 | "type": "Control", |
| 551 | - "relayout-enabled": false, | |
| 552 | 531 | "actors": [ |
| 553 | 532 | { |
| 554 | 533 | "type": "Control", |
| 555 | - "relayout-enabled": false, | |
| 556 | - "actors": [], | |
| 557 | 534 | "name": "Control 4", |
| 558 | 535 | "position": [ |
| 559 | 536 | 0, |
| ... | ... | @@ -629,15 +606,12 @@ |
| 629 | 606 | }, |
| 630 | 607 | { |
| 631 | 608 | "type": "Control", |
| 632 | - "relayout-enabled": false, | |
| 633 | 609 | "actors": [ |
| 634 | 610 | { |
| 635 | 611 | "type": "Control", |
| 636 | - "relayout-enabled": false, | |
| 637 | 612 | "actors": [ |
| 638 | 613 | { |
| 639 | 614 | "type": "Control", |
| 640 | - "actors": [], | |
| 641 | 615 | "name": "Container 13", |
| 642 | 616 | "position": [ |
| 643 | 617 | 0, |
| ... | ... | @@ -713,8 +687,6 @@ |
| 713 | 687 | }, |
| 714 | 688 | { |
| 715 | 689 | "type": "Control", |
| 716 | - "relayout-enabled": false, | |
| 717 | - "actors": [], | |
| 718 | 690 | "name": "Container 11", |
| 719 | 691 | "position": [ |
| 720 | 692 | 0, |
| ... | ... | @@ -753,16 +725,12 @@ |
| 753 | 725 | }, |
| 754 | 726 | { |
| 755 | 727 | "type": "Control", |
| 756 | - "relayout-enabled": false, | |
| 757 | 728 | "actors": [ |
| 758 | 729 | { |
| 759 | 730 | "type": "Control", |
| 760 | - "relayout-enabled": false, | |
| 761 | 731 | "actors": [ |
| 762 | 732 | { |
| 763 | 733 | "type": "Control", |
| 764 | - "relayout-enabled": false, | |
| 765 | - "actors": [], | |
| 766 | 734 | "name": "Container 15", |
| 767 | 735 | "position": [ |
| 768 | 736 | 0, |
| ... | ... | @@ -838,8 +806,6 @@ |
| 838 | 806 | }, |
| 839 | 807 | { |
| 840 | 808 | "type": "Control", |
| 841 | - "relayout-enabled": false, | |
| 842 | - "actors": [], | |
| 843 | 809 | "name": "Container 16", |
| 844 | 810 | "position": [ |
| 845 | 811 | 0, |
| ... | ... | @@ -949,7 +915,27 @@ |
| 949 | 915 | 0.3411764705882353, |
| 950 | 916 | 1 |
| 951 | 917 | ] |
| 918 | + }, | |
| 919 | + { | |
| 920 | + "type": "TextLabel", | |
| 921 | + "name": "text", | |
| 922 | + "parent-origin": "CENTER", | |
| 923 | + "anchor-point": "CENTER", | |
| 924 | + "text": "START", | |
| 925 | + "point-size": 20, | |
| 926 | + "signals": [ | |
| 927 | + { | |
| 928 | + "name": "tapped", | |
| 929 | + "action": "play", | |
| 930 | + "animation": "Animation_1" | |
| 931 | + }, | |
| 932 | + { | |
| 933 | + "name": "tapped", | |
| 934 | + "action": "play", | |
| 935 | + "animation": "HideText" | |
| 952 | 936 | } |
| 937 | + ] | |
| 938 | + } | |
| 953 | 939 | ], |
| 954 | 940 | "name": "Container 1", |
| 955 | 941 | "position": [ |
| ... | ... | @@ -986,26 +972,6 @@ |
| 986 | 972 | 0.32941176470588235, |
| 987 | 973 | 1 |
| 988 | 974 | ] |
| 989 | - }, | |
| 990 | - { | |
| 991 | - "type": "TextLabel", | |
| 992 | - "name": "text", | |
| 993 | - "parent-origin": "CENTER", | |
| 994 | - "anchor-point": "CENTER", | |
| 995 | - "text": "START", | |
| 996 | - "point-size": 20, | |
| 997 | - "signals": [ | |
| 998 | - { | |
| 999 | - "name": "tapped", | |
| 1000 | - "action": "play", | |
| 1001 | - "animation": "Animation_1" | |
| 1002 | - }, | |
| 1003 | - { | |
| 1004 | - "name": "tapped", | |
| 1005 | - "action": "play", | |
| 1006 | - "animation": "HideText" | |
| 1007 | - } | |
| 1008 | - ] | |
| 1009 | 975 | } |
| 1010 | 976 | ], |
| 1011 | 977 | "animations": { | ... | ... |
resources/scripts/background-color.json
| 1 | 1 | /* |
| 2 | - * Copyright (c) 2014 Samsung Electronics Co., Ltd. | |
| 2 | + * Copyright (c) 2015 Samsung Electronics Co., Ltd. | |
| 3 | 3 | * |
| 4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | 5 | * you may not use this file except in compliance with the License. |
| ... | ... | @@ -19,10 +19,13 @@ |
| 19 | 19 | // A TextLabel with a red background |
| 20 | 20 | { |
| 21 | 21 | "type": "TextLabel", |
| 22 | + "draw-mode": "OVERLAY", | |
| 22 | 23 | "text": "Hello World", |
| 23 | 24 | "parent-origin": "TOP_CENTER", |
| 24 | 25 | "anchor-point": "TOP_CENTER", |
| 25 | 26 | "background-color": [1, 0, 0, 1], |
| 27 | + "position": [0, 50, 0], | |
| 28 | + "point-size": 40, | |
| 26 | 29 | "size": [400, 150, 1] |
| 27 | 30 | }, |
| 28 | 31 | ... | ... |
resources/scripts/table-view.json
shared/dali-demo-strings.h
| ... | ... | @@ -49,6 +49,7 @@ extern "C" |
| 49 | 49 | #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI") |
| 50 | 50 | #define DALI_DEMO_STR_TITLE_IMAGE_FITTING_SAMPLING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_FITTING_SAMPLING") |
| 51 | 51 | #define DALI_DEMO_STR_TITLE_IMAGE_SCALING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_SCALING") |
| 52 | +#define DALI_DEMO_STR_TITLE_TEXT_FIELD dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_FIELD") | |
| 52 | 53 | #define DALI_DEMO_STR_TITLE_TEXT_LABEL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_LABEL") |
| 53 | 54 | #define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE") |
| 54 | 55 | #define DALI_DEMO_STR_TITLE_EMOJI_TEXT dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_EMOJI_TEXT") |
| ... | ... | @@ -77,6 +78,7 @@ extern "C" |
| 77 | 78 | #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI "Script Based UI" |
| 78 | 79 | #define DALI_DEMO_STR_TITLE_IMAGE_FITTING_SAMPLING "Image Fitting and Sampling" |
| 79 | 80 | #define DALI_DEMO_STR_TITLE_IMAGE_SCALING "Image Scaling Grid" |
| 81 | +#define DALI_DEMO_STR_TITLE_TEXT_FIELD "Text Field" | |
| 80 | 82 | #define DALI_DEMO_STR_TITLE_TEXT_LABEL "Text Label" |
| 81 | 83 | #define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE "Text Scripts" |
| 82 | 84 | #define DALI_DEMO_STR_TITLE_EMOJI_TEXT "Emoji Text" | ... | ... |
shared/view.h
| ... | ... | @@ -19,6 +19,9 @@ |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | #include <dali-toolkit/dali-toolkit.h> |
| 22 | +#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h> | |
| 23 | +#include <dali-toolkit/devel-api/styling/style-manager.h> | |
| 24 | + | |
| 22 | 25 | |
| 23 | 26 | namespace DemoHelper |
| 24 | 27 | { |
| ... | ... | @@ -50,13 +53,6 @@ const float DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); |
| 50 | 53 | const Dali::Toolkit::Alignment::Padding DEFAULT_PLAY_PADDING(12.0f, 12.0f, 12.0f, 12.0f); |
| 51 | 54 | const Dali::Toolkit::Alignment::Padding DEFAULT_MODE_SWITCH_PADDING(8.0f, 8.0f, 8.0f, 8.0f); |
| 52 | 55 | |
| 53 | -void RequestThemeChange() | |
| 54 | -{ | |
| 55 | - // Provide the stylesheet | |
| 56 | - Dali::Toolkit::StyleManager styleManager = Dali::Toolkit::StyleManager::Get(); | |
| 57 | - styleManager.RequestThemeChange( DALI_DEMO_THEME_PATH ); | |
| 58 | -} | |
| 59 | - | |
| 60 | 56 | float ScalePointSize(int pointSize) |
| 61 | 57 | { |
| 62 | 58 | Dali::Vector2 dpi = Dali::Stage::GetCurrent().GetDpi(); |
| ... | ... | @@ -83,16 +79,12 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, |
| 83 | 79 | |
| 84 | 80 | // Tool bar |
| 85 | 81 | Dali::Image image = Dali::ResourceImage::New( toolbarImagePath ); |
| 86 | - Dali::ImageActor toolBarBackground = Dali::ImageActor::New( image ); | |
| 87 | - toolBarBackground.SetName( "TOOLBAR_BACKGROUND" ); | |
| 88 | - toolBarBackground.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); | |
| 89 | 82 | toolBar = Dali::Toolkit::ToolBar::New(); |
| 90 | 83 | toolBar.SetName( "TOOLBAR" ); |
| 91 | - toolBar.SetBackground( toolBarBackground ); | |
| 84 | + toolBar.SetBackgroundImage( image ); | |
| 92 | 85 | toolBar.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER ); |
| 93 | 86 | toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); |
| 94 | 87 | toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); |
| 95 | - toolBarBackground.SetSortModifier(1.0f); | |
| 96 | 88 | |
| 97 | 89 | // Add the tool bar to the too bar layer. |
| 98 | 90 | toolBarLayer.Add( toolBar ); | ... | ... |