]> git.sesse.net Git - vlc/commitdiff
skins2: make default more consistent for video control
authorErwan Tulou <erwan10@videolan.org>
Thu, 25 Feb 2010 09:11:16 +0000 (10:11 +0100)
committerErwan Tulou <erwan10@videolan.org>
Thu, 25 Feb 2010 09:34:38 +0000 (10:34 +0100)
For a video control, default values are contradictory, in
a sense that a video control is not resizable and autoresize
is true. By default, this results in skins resizing to fit a new video, but
the inner video not using this extra space. (see AirFlow for instance)

This patch ensures that if autoresize is true, default behavior for a video
 control is to be resizeable.

modules/gui/skins2/parser/builder.cpp

index 5db40315b57cbb31d63e230b2910493300c9fe76..3254c7299336afc37453ed489c93e25b8d40af1b 100644 (file)
@@ -1010,14 +1010,22 @@ 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 )
+    {
+        Data.m_leftTop = "lefttop";
+        Data.m_rightBottom = "rightbottom";
+    }
+
     // Compute the position of the control
     const GenericRect *pRect;
     GET_BOX( pRect, rData.m_panelId , pLayout);
-    const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
-                                       rData.m_xPos, rData.m_yPos,
-                                       rData.m_width, rData.m_height,
+    const Position pos = makePosition( Data.m_leftTop, Data.m_rightBottom,
+                                       Data.m_xPos, Data.m_yPos,
+                                       Data.m_width, Data.m_height,
                                        *pRect,
-                                       rData.m_xKeepRatio, rData.m_yKeepRatio );
+                                       Data.m_xKeepRatio, Data.m_yKeepRatio );
 
     pLayout->addControl( pVideo, pos, rData.m_layer );
 }