[vlc-devel] commit: skins2: make default more consistent for video control ( Erwan Tulou )
git version control
git at videolan.org
Thu Feb 25 10:40:30 CET 2010
vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Thu Feb 25 10:11:16 2010 +0100| [6c4ac35e3d336ad70028030f8bff9d21632660ca] | committer: 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6c4ac35e3d336ad70028030f8bff9d21632660ca
---
modules/gui/skins2/parser/builder.cpp | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/modules/gui/skins2/parser/builder.cpp b/modules/gui/skins2/parser/builder.cpp
index 5db4031..3254c72 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 );
}
More information about the vlc-devel
mailing list