From: David Steele Date: Thu, 4 Aug 2016 15:15:19 +0000 (+0100) Subject: Updated demos to remove indicator where appropriate X-Git-Tag: dali_1.2.0~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=68084ad1ce68796f9ae1db1cd6692ffaa5d5e3c9 Updated demos to remove indicator where appropriate Removed indicator from demo toolbar, and from other examples that don't use toolbar and have a UI at the top of the display. Change-Id: Ifd3b3c5f916f249f492ff154a0ca28054763ee6e Signed-off-by: David Steele --- diff --git a/examples/blocks/blocks-example.cpp b/examples/blocks/blocks-example.cpp index 28eb286..03a99e6 100644 --- a/examples/blocks/blocks-example.cpp +++ b/examples/blocks/blocks-example.cpp @@ -228,6 +228,9 @@ public: { Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + // Creates a default view with a default tool bar. // The view is added to the stage. Toolkit::ToolBar toolBar; diff --git a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp index 3af560d..7cdc4a6 100644 --- a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp +++ b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp @@ -175,6 +175,9 @@ public: // Get a handle to the stage Stage stage = Stage::GetCurrent(); + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + // Background image: Dali::Property::Map backgroundImage; backgroundImage.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE ); diff --git a/examples/image-view-svg/image-view-svg-example.cpp b/examples/image-view-svg/image-view-svg-example.cpp index 7c08b44..12180f2 100644 --- a/examples/image-view-svg/image-view-svg-example.cpp +++ b/examples/image-view-svg/image-view-svg-example.cpp @@ -66,6 +66,9 @@ public: Vector2 stageSize = stage.GetSize(); mActorSize = stageSize/2.f; + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + stage.KeyEventSignal().Connect(this, &ImageSvgController::OnKeyEvent); // Background, for receiving gestures diff --git a/examples/native-image-source/native-image-source-example.cpp b/examples/native-image-source/native-image-source-example.cpp index fe676dc..cf9304b 100644 --- a/examples/native-image-source/native-image-source-example.cpp +++ b/examples/native-image-source/native-image-source-example.cpp @@ -146,6 +146,10 @@ public: // Get a handle to the stage Stage stage = Stage::GetCurrent(); stage.SetBackgroundColor( Color::WHITE ); + + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + stage.KeyEventSignal().Connect(this, &NativeImageSourceController::OnKeyEvent); mButtonRefreshAlways = PushButton::New(); diff --git a/examples/page-turn-view/page-turn-view-example.cpp b/examples/page-turn-view/page-turn-view-example.cpp index b1b71ab..3d037eb 100644 --- a/examples/page-turn-view/page-turn-view-example.cpp +++ b/examples/page-turn-view/page-turn-view-example.cpp @@ -242,6 +242,9 @@ void PageTurnController::OnInit( Application& app ) Stage::GetCurrent().KeyEventSignal().Connect(this, &PageTurnController::OnKeyEvent); + // Hide the indicator bar + app.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + Stage stage = Stage::GetCurrent(); Vector2 stageSize = stage.GetSize(); diff --git a/examples/primitive-shapes/primitive-shapes-example.cpp b/examples/primitive-shapes/primitive-shapes-example.cpp index bf8478d..9329371 100644 --- a/examples/primitive-shapes/primitive-shapes-example.cpp +++ b/examples/primitive-shapes/primitive-shapes-example.cpp @@ -68,6 +68,9 @@ public: Stage stage = Stage::GetCurrent(); stage.SetBackgroundColor( Color::WHITE ); + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + //Set up layer to place UI on. Layer layer = Layer::New(); layer.SetParentOrigin( ParentOrigin::CENTER ); diff --git a/examples/renderer-stencil/renderer-stencil-example.cpp b/examples/renderer-stencil/renderer-stencil-example.cpp index 5a92cd6..27385f0 100644 --- a/examples/renderer-stencil/renderer-stencil-example.cpp +++ b/examples/renderer-stencil/renderer-stencil-example.cpp @@ -116,6 +116,9 @@ private: { Stage stage = Stage::GetCurrent(); + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + // Creates the background image. Toolkit::Control background = Dali::Toolkit::Control::New(); background.SetAnchorPoint( Dali::AnchorPoint::CENTER ); diff --git a/examples/text-field/text-field-example.cpp b/examples/text-field/text-field-example.cpp index 6d357eb..1b21b48 100644 --- a/examples/text-field/text-field-example.cpp +++ b/examples/text-field/text-field-example.cpp @@ -75,6 +75,9 @@ public: stage.SetBackgroundColor( Vector4( 0.04f, 0.345f, 0.392f, 1.0f ) ); stage.KeyEventSignal().Connect(this, &TextFieldExample::OnKeyEvent); + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + mButton = CreateFolderButton(); mButton.ClickedSignal().Connect( this, &TextFieldExample::OnButtonClicked ); stage.Add( mButton ); diff --git a/examples/tilt/tilt-example.cpp b/examples/tilt/tilt-example.cpp index 0adc72e..230704a 100644 --- a/examples/tilt/tilt-example.cpp +++ b/examples/tilt/tilt-example.cpp @@ -59,6 +59,9 @@ public: stage.GetRootLayer().TouchSignal().Connect( this, &TiltController::OnTouch ); CreateSensor(); + + // Connect signals to allow Back and Escape to exit. + stage.KeyEventSignal().Connect( this, &TiltController::OnKeyEvent ); } void CreateSensor() @@ -88,6 +91,21 @@ public: mTextLabel.RotateBy(pitchRot);; } + /** + * @brief OnKeyEvent signal handler. + * @param[in] event The key event information + */ + void OnKeyEvent( const KeyEvent& event ) + { + if( event.state == KeyEvent::Down ) + { + if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) + { + mApplication.Quit(); + } + } + } + private: Application& mApplication; TiltSensor mTiltSensor; diff --git a/shared/view.h b/shared/view.h index 2606fd2..cc7ca8f 100644 --- a/shared/view.h +++ b/shared/view.h @@ -118,6 +118,9 @@ Dali::Layer CreateView( Dali::Application& application, { Dali::Stage stage = Dali::Stage::GetCurrent(); + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + // Create default View. view = Dali::Toolkit::Control::New(); view.SetAnchorPoint( Dali::AnchorPoint::CENTER );