mResizeRequired( false ),
mPaused( false ),
mPausedManually( false ),
- mWindowVisible( true ),
+ mWidgetVisible( false ),
mPreviewEnable( true ),
mKeepWidgetSize(false),
mIsReadyToRender(false)
mResizeRequired( false ),
mPaused( false ),
mPausedManually( false ),
- mWindowVisible( true ),
+ mWidgetVisible( false ),
mPreviewEnable( true ),
mKeepWidgetSize(false),
mIsReadyToRender(false)
auto self = Self();
self.TouchedSignal().Connect( this, &WidgetView::OnTouch );
self.WheelEventSignal().Connect( this, &WidgetView::OnWheelEvent );
+ self.InheritedVisibilityChangedSignal().Connect( this, &WidgetView::OnInheritedVisibilityChanged );
// Accessibility
self.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE, Dali::Accessibility::Role::FILLER);
case WIDGET_INSTANCE_EVENT_RESUME:
{
// Call Resume/Pause for reloading
- bool needPaused = IsOutOfScreen();
- if( mWindowVisible && !needPaused)
+ if( mWidgetVisible && !IsOutOfScreen())
{
ResumeWidgetInternally();
}
void WidgetView::OnSceneConnection( int depth )
{
- Control::OnSceneConnection( depth );
- Window window = DevelWindow::Get( Self() );
- if( window )
- {
- DevelWindow::VisibilityChangedSignal( window ).Connect( this, &WidgetView::OnWindowVisibilityChanged );
+ // Add Notification for check WidgetView is out-of-screen or not.
+ auto self = Self();
+ mPositionUpdateNotification = self.AddPropertyNotification( Actor::Property::WORLD_POSITION, StepCondition( 1.0f, 1.0f ) );
+ mPositionUpdateNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
+ mSizeUpdateNotification = self.AddPropertyNotification( Actor::Property::SIZE, StepCondition( 1.0f, 1.0f ) );
+ mSizeUpdateNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
+ mScaleUpdateNotification = self.AddPropertyNotification( Actor::Property::WORLD_SCALE, StepCondition( 0.1f, 1.0f ) );
+ mScaleUpdateNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
- // Add Notification for check WidgetView is out-of-screen or not.
- auto self = Self();
- mPositionUpdateNotification = self.AddPropertyNotification( Actor::Property::WORLD_POSITION, StepCondition( 1.0f, 1.0f ) );
- mPositionUpdateNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
- mSizeUpdateNotification = self.AddPropertyNotification( Actor::Property::SIZE, StepCondition( 1.0f, 1.0f ) );
- mSizeUpdateNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
- mScaleUpdateNotification = self.AddPropertyNotification( Actor::Property::WORLD_SCALE, StepCondition( 0.1f, 1.0f ) );
- mScaleUpdateNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
+ mPositionUpdateNotification.NotifySignal().Connect( this, &WidgetView::OnUpdateArea );
+ mSizeUpdateNotification.NotifySignal().Connect( this, &WidgetView::OnUpdateArea );
+ mScaleUpdateNotification.NotifySignal().Connect( this, &WidgetView::OnUpdateArea );
- mPositionUpdateNotification.NotifySignal().Connect( this, &WidgetView::OnUpdateArea );
- mSizeUpdateNotification.NotifySignal().Connect( this, &WidgetView::OnUpdateArea );
- mScaleUpdateNotification.NotifySignal().Connect( this, &WidgetView::OnUpdateArea );
- }
+ Control::OnSceneConnection( depth );
}
void WidgetView::OnSceneDisconnection()
{
+ Self().RemovePropertyNotification( mPositionUpdateNotification );
+ Self().RemovePropertyNotification( mSizeUpdateNotification );
+ Self().RemovePropertyNotification( mScaleUpdateNotification );
Control::OnSceneDisconnection();
- Window window = DevelWindow::Get( Self() );
- if( window )
- {
- DevelWindow::VisibilityChangedSignal( window ).Disconnect( this, &WidgetView::OnWindowVisibilityChanged );
-
- Self().RemovePropertyNotification( mPositionUpdateNotification );
- Self().RemovePropertyNotification( mSizeUpdateNotification );
- Self().RemovePropertyNotification( mScaleUpdateNotification );
- }
}
-void WidgetView::OnWindowVisibilityChanged( Window window, bool visible )
+void WidgetView::OnInheritedVisibilityChanged( Actor actor, bool isVisible )
{
- mWindowVisible = visible;
- bool needPaused = IsOutOfScreen();
+ mWidgetVisible = isVisible;
if( mPausedManually )
{
- mPaused = ( needPaused || !mWindowVisible );
+ mPaused = ( !mWidgetVisible || IsOutOfScreen());
DALI_LOG_RELEASE_INFO("Do not resume widget, because widget is paued manually [%p]\n", this);
return;
}
- if( mWindowVisible && !needPaused)
+ const bool needPaused = IsOutOfScreen();
+ if( mWidgetVisible && !needPaused)
{
ResumeWidgetInternally();
}
{
PauseWidgetInternally();
}
- DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::OnWindowVisibilityChanged: visibility is changed (visible: %d) [%p]\n", visible, this );
+ DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::OnInheritedVisibilityChanged: visibility is changed (visible: %d) [%p]\n", visible, this );
}
void WidgetView::OnUpdateArea( Dali::PropertyNotification& source )