Commit bdc5380d authored by Erwan Tulou's avatar 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.
(cherry picked from commit 07bf40d589a3f4fa9a608c50d7599b8b9b7059bf)
parent 0e04933d
...@@ -1024,12 +1024,19 @@ void Builder::addVideo( const BuilderData::Video &rData ) ...@@ -1024,12 +1024,19 @@ void Builder::addVideo( const BuilderData::Video &rData )
pVisible ); pVisible );
m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pVideo ); m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pVideo );
// if autoresize is true, force the control to resize
BuilderData::Video Data = rData; BuilderData::Video Data = rData;
if( rData.m_autoResize ) if( Data.m_autoResize )
{ {
Data.m_leftTop = "lefttop"; // force autoresize to false if the control is not able to
Data.m_rightBottom = "rightbottom"; // 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 // Compute the position of the control
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment