From: Kimmo Hoikka Date: Wed, 19 Nov 2014 18:45:00 +0000 (+0000) Subject: Only make indicator visible when its actually needed X-Git-Tag: dali_1.0.20~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=408e5d2cd2dec7256c14097918582d0739a7c0f6;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Only make indicator visible when its actually needed Change-Id: I64975cc0e59b1f6ab5c6d4af9bff7dda3045382c --- diff --git a/adaptors/common/application-impl.cpp b/adaptors/common/application-impl.cpp index a925de5..fa976b9 100644 --- a/adaptors/common/application-impl.cpp +++ b/adaptors/common/application-impl.cpp @@ -196,9 +196,6 @@ void Application::OnInit() mInitialized = true; - // in default, auto hide indicator mode - mWindow.ShowIndicator(Dali::Window::AUTO); - Dali::Application application(this); mInitSignalV2.Emit( application ); } diff --git a/adaptors/common/indicator-impl.cpp b/adaptors/common/indicator-impl.cpp index b2d6720..9b8679b 100644 --- a/adaptors/common/indicator-impl.cpp +++ b/adaptors/common/indicator-impl.cpp @@ -380,7 +380,7 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat mRotation( 0 ), mImageWidth( 0 ), mImageHeight( 0 ), - mVisible( Dali::Window::VISIBLE ), + mVisible( Dali::Window::INVISIBLE ), mIsShowing( true ), mIsAnimationPlaying( false ) { @@ -433,6 +433,8 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat { AccessibilityManager::GetImplementation( accessibilityManager ).SetIndicator( this ); } + // hide the indicator by default + mIndicatorActor.SetVisible( false ); } Indicator::~Indicator() @@ -508,6 +510,10 @@ void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool { UpdateImageData(); } + if ( visibleMode != Dali::Window::INVISIBLE ) + { + mIndicatorActor.SetVisible( true ); + } mVisible = visibleMode; @@ -1265,8 +1271,8 @@ void Indicator::ShowIndicator(float duration) if( mVisible == Dali::Window::AUTO ) { - // check the stage touch - Dali::Stage::GetCurrent().TouchedSignal().Connect( this, &Indicator::OnStageTouched ); + // check the stage touch + Dali::Stage::GetCurrent().TouchedSignal().Connect( this, &Indicator::OnStageTouched ); } } else @@ -1278,8 +1284,8 @@ void Indicator::ShowIndicator(float duration) if( mVisible == Dali::Window::AUTO ) { - // check the stage touch - Dali::Stage::GetCurrent().TouchedSignal().Disconnect( this, &Indicator::OnStageTouched ); + // check the stage touch + Dali::Stage::GetCurrent().TouchedSignal().Disconnect( this, &Indicator::OnStageTouched ); } } } @@ -1295,6 +1301,11 @@ bool Indicator::OnShowTimer() void Indicator::OnAnimationFinished(Dali::Animation& animation) { mIsAnimationPlaying = false; + // once animation is finished and indicator is hidden, take it off stage + if( !mIsShowing ) + { + mIndicatorActor.SetVisible( false ); + } } void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture ) diff --git a/adaptors/x11/window-impl-x.cpp b/adaptors/x11/window-impl-x.cpp index be3bf51..fc1dd96 100644 --- a/adaptors/x11/window-impl-x.cpp +++ b/adaptors/x11/window-impl-x.cpp @@ -316,7 +316,7 @@ void Window::SetClass(std::string name, std::string klass) Window::Window() : mSurface(NULL), mIndicatorStyle(Dali::Window::CHANGEABLE_COLOR), - mIndicatorVisible(Dali::Window::VISIBLE), + mIndicatorVisible(Dali::Window::INVISIBLE), mIndicatorIsShown(false), mShowRotatedIndicatorOnClose(false), mStarted(false), @@ -555,7 +555,7 @@ Dali::DragAndDropDetector Window::GetDragAndDropDetector() const void Window::OnStart() { - DoShowIndicator( mIndicatorOrientation ); + ShowIndicator( mIndicatorVisible ); } void Window::OnPause()