]> git.sesse.net Git - vlc/commitdiff
* generic_layout.cpp: don't draw controls of an invisible layout
authorCyril Deguet <asmax@videolan.org>
Sun, 30 Apr 2006 13:44:20 +0000 (13:44 +0000)
committerCyril Deguet <asmax@videolan.org>
Sun, 30 Apr 2006 13:44:20 +0000 (13:44 +0000)
modules/gui/skins2/src/generic_layout.cpp
modules/gui/skins2/src/generic_layout.hpp

index 8baf3bc80c5f2a0eff02af6eb86d8518d1ec26a1..e6e242dfdf7e0ad8f76601d070220b2d8e2a03c1 100644 (file)
@@ -35,7 +35,8 @@ GenericLayout::GenericLayout( intf_thread_t *pIntf, int width, int height,
                               int maxHeight ):
     SkinObject( pIntf ), m_pWindow( NULL ), m_width( width ),
     m_height( height ), m_minWidth( minWidth ), m_maxWidth( maxWidth ),
-    m_minHeight( minHeight ), m_maxHeight( maxHeight ), m_pVideoControl( NULL )
+    m_minHeight( minHeight ), m_maxHeight( maxHeight ), m_pVideoControl( NULL ),
+    m_visible( false )
 {
     // Get the OSFactory
     OSFactory *pOsFactory = OSFactory::instance( getIntf() );
@@ -222,6 +223,10 @@ void GenericLayout::refreshAll()
 
 void GenericLayout::refreshRect( int x, int y, int width, int height )
 {
+    // Do nothing if the layout is hidden
+    if( !m_visible )
+        return;
+
     // Draw all the controls of the layout
     list<LayeredControl>::const_iterator iter;
     list<LayeredControl>::const_iterator iterVideo = m_controlList.end();
@@ -301,6 +306,8 @@ void GenericLayout::addAnchor( Anchor *pAnchor )
 
 void GenericLayout::onShow()
 {
+    m_visible = true;
+
     refreshAll();
     // TODO find a better way to handle the vout ?
     if( m_pVideoControl )
@@ -312,6 +319,8 @@ void GenericLayout::onShow()
 
 void GenericLayout::onHide()
 {
+    m_visible = false;
+
     // TODO find a better way to handle the vout ?
     if( m_pVideoControl )
     {
index e0e7846e0c63a3b80d74d99df08667d052a7a233..470f6710e03b115fb7302139cc7cb89dab627a51 100644 (file)
@@ -143,6 +143,8 @@ class GenericLayout: public SkinObject, public Box
         CtrlVideo *m_pVideoControl;
         /// List of the anchors in the layout
         list<Anchor*> m_anchorList;
+        /// Flag to know if the layout is visible
+        bool m_visible;
 };