From: Erwan Tulou Date: Thu, 25 Feb 2010 09:11:16 +0000 (+0100) Subject: skins2: make default more consistent for video control X-Git-Tag: 1.1.0-pre1~685 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6c4ac35e3d336ad70028030f8bff9d21632660ca;p=vlc 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. --- diff --git a/modules/gui/skins2/parser/builder.cpp b/modules/gui/skins2/parser/builder.cpp index 5db40315b5..3254c72993 100644 --- a/modules/gui/skins2/parser/builder.cpp +++ b/modules/gui/skins2/parser/builder.cpp @@ -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 ); }