Commit 6c4ac35e authored by Erwan Tulou's avatar Erwan Tulou

skins2: make default more consistent for video control

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.
parent d1540b17
......@@ -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 );
}
......
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