From: taeyoon Date: Tue, 13 Dec 2016 02:09:07 +0000 (+0900) Subject: [3.0] Add UpdateTopMargin in tizen indicator X-Git-Tag: accepted/tizen/3.0/common/20161216.124145^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fde27bebc510312200810b6404ba06730ffd8c78;hp=f99a48ab0bfb8a45cd7376c7e9f5b7c8ba1f2ec4;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [3.0] Add UpdateTopMargin in tizen indicator Change-Id: Ibe8073696ca7c3a3404a24187ac03e2e7dc72abe --- diff --git a/adaptors/tizen/ecore-indicator-impl-tizen.cpp b/adaptors/tizen/ecore-indicator-impl-tizen.cpp index cdff69f..2439aac 100644 --- a/adaptors/tizen/ecore-indicator-impl-tizen.cpp +++ b/adaptors/tizen/ecore-indicator-impl-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -507,7 +507,8 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat mCurrentSharedFile( 0 ), mSharedBufferType( BUFFER_TYPE_SHM ), mImpl( NULL ), - mBackgroundVisible( false ) + mBackgroundVisible( false ), + mTopMargin( 0 ) { mIndicatorContentActor = Dali::Actor::New(); mIndicatorContentActor.SetParentOrigin( ParentOrigin::TOP_CENTER ); @@ -654,6 +655,7 @@ void Indicator::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode ) mIndicatorContentActor.RemoveRenderer( mBackgroundRenderer ); mBackgroundVisible = false; } + UpdateTopMargin(); } void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate ) @@ -684,6 +686,7 @@ void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool } mVisible = visibleMode; + UpdateTopMargin(); if( mForegroundRenderer && ( mForegroundRenderer.GetTextures().GetTexture( 0u ) || @@ -885,6 +888,7 @@ void Indicator::Resize( int width, int height ) mIndicatorContentActor.SetSize( mImageWidth, mImageHeight ); mIndicatorActor.SetSize( mImageWidth, mImageHeight ); mEventActor.SetSize(mImageWidth, mImageHeight); + UpdateTopMargin(); } } @@ -1085,6 +1089,16 @@ void Indicator::UpdateIndicatorImage( Any source ) Dali::Stage::GetCurrent().KeepRendering( 0.0f ); } +void Indicator::UpdateTopMargin() +{ + int newMargin = (mVisible == Dali::Window::VISIBLE && mOpacityMode == Dali::Window::OPAQUE) ? mImageHeight : 0; + if (mTopMargin != newMargin) + { + mTopMargin = newMargin; + mAdaptor->IndicatorSizeChanged( mTopMargin ); + } +} + void Indicator::UpdateVisibility() { if( CheckVisibleState() )