[vlc-commits] commit: skins2: fix video autoresize default when contradictory ( Erwan Tulou )

git at videolan.org git at videolan.org
Sat Aug 14 14:06:15 CEST 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Sat Aug 14 11:28:35 2010 +0200| [07bf40d589a3f4fa9a608c50d7599b8b9b7059bf] | committer: Erwan Tulou 

skins2: fix video autoresize default when contradictory

when parameters for a video control are contradictory (this occurs when the
skin developper only relies on default values), it is better not to resize,
since there is no easy means to check if the layout is really set up to handle
resizing properly.

This fixes some ugly behavior for a few skins from the skin repository
 on the website.

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

 modules/gui/skins2/parser/builder.cpp |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/gui/skins2/parser/builder.cpp b/modules/gui/skins2/parser/builder.cpp
index 72efbe6..df0f550 100644
--- a/modules/gui/skins2/parser/builder.cpp
+++ b/modules/gui/skins2/parser/builder.cpp
@@ -1028,12 +1028,19 @@ void Builder::addVideo( const BuilderData::Video &rData )
         pVisible );
     m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pVideo );
 
-    // if autoresize is true, force the control to resize
     BuilderData::Video Data = rData;
-    if( rData.m_autoResize )
+    if( Data.m_autoResize )
     {
-        Data.m_leftTop = "lefttop";
-        Data.m_rightBottom = "rightbottom";
+        // force autoresize to false if the control is not able to
+        // freely resize within its container
+        if( Data.m_xKeepRatio || Data.m_yKeepRatio ||
+            !( Data.m_leftTop == "lefttop" &&
+               Data.m_rightBottom == "rightbottom" ) )
+        {
+            msg_Err( getIntf(),
+                "video: resize policy and autoresize are not compatible" );
+            Data.m_autoResize = false;
+        }
     }
 
     // Compute the position of the control



More information about the vlc-commits mailing list