[vlc-commits] skins2: resize only similar layouts on-the-fly

Erwan Tulou git at videolan.org
Mon Apr 1 03:18:53 CEST 2013


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Mon Apr  1 02:10:56 2013 +0200| [fe29bc614b315398b69ab735f01b54d1f669fa42] | committer: Erwan Tulou

skins2: resize only similar layouts on-the-fly

This fixes a regression brought by ff74e967e9777ed821734077051f55ac84a173a5

Forcefully resizing only makes sense when layouts were designed to be similar
in size in the first place. Furthermore, it cuts off a larger layout if a
smaller one is first defined when loading a skin.

Ideally, the skins2 dtd should be extended for skins developers to explicitly
express whether two layouts are tightly-coupled or not, i.e should always be
kept the same size whatever the subsequent resizing performed by the user.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe29bc614b315398b69ab735f01b54d1f669fa42
---

 modules/gui/skins2/src/top_window.cpp |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/gui/skins2/src/top_window.cpp b/modules/gui/skins2/src/top_window.cpp
index 4c27bac..b981128 100644
--- a/modules/gui/skins2/src/top_window.cpp
+++ b/modules/gui/skins2/src/top_window.cpp
@@ -351,7 +351,13 @@ void TopWindow::setActiveLayout( GenericLayout *pLayout )
         }
         // The current layout becomes inactive
         m_pActiveLayout->getActiveVar().set( false );
-        pLayout->resize( m_pActiveLayout->getWidth(), m_pActiveLayout->getHeight() );
+
+        // if both layouts have the same original size, infer a
+        // subsequent resize of the active layout has to be applied
+        // to the new layout about to become active
+        if( pLayout->isTightlyCoupledWith( *m_pActiveLayout ) )
+            pLayout->resize( m_pActiveLayout->getWidth(),
+                             m_pActiveLayout->getHeight() );
     }
 
     pLayout->setWindow( this );



More information about the vlc-commits mailing list