1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00

* winamp2.xml: support smaller volume bars (65 pixels instead of 68)

* builder.cpp: don't build a subbitmap or a fontbitmap if it already
  exists (so if the xml contains elements with the same id, the first
  valid one is kept)
This commit is contained in:
Cyril Deguet 2005-11-13 12:12:25 +00:00
parent 1bc1b8315c
commit b827c556d5
3 changed files with 15 additions and 2 deletions

View File

@ -159,6 +159,12 @@ void Builder::addBitmap( const BuilderData::Bitmap &rData )
void Builder::addSubBitmap( const BuilderData::SubBitmap &rData )
{
if( m_pTheme->m_bitmaps.find( rData.m_id ) != m_pTheme->m_bitmaps.end() )
{
msg_Dbg( getIntf(), "Bitmap %s already exists", rData.m_id.c_str() );
return;
}
// Get the parent bitmap
GenericBitmap *pParentBmp = NULL;
GET_BMP( pParentBmp, rData.m_parent );
@ -181,6 +187,12 @@ void Builder::addSubBitmap( const BuilderData::SubBitmap &rData )
void Builder::addBitmapFont( const BuilderData::BitmapFont &rData )
{
if( m_pTheme->m_fonts.find( rData.m_id ) != m_pTheme->m_fonts.end() )
{
msg_Dbg( getIntf(), "Font %s already exists", rData.m_id.c_str() );
return;
}
GenericBitmap *pBmp =
new FileBitmap( getIntf(), m_pImageHandler,
getFilePath( rData.m_file ), 0 );

View File

@ -106,7 +106,7 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
RequireDefault( "width" );
RequireDefault( "height" );
const BuilderData::SubBitmap bitmap( uniqueId( attr["id"] ),
const BuilderData::SubBitmap bitmap( attr["id"],
m_curBitmapId, atoi( attr["x"] ), atoi( attr["y"] ),
atoi( attr["width"] ), atoi( attr["height"] ) );
m_pData->m_listSubBitmap.push_back( bitmap );

View File

@ -117,12 +117,13 @@
</Bitmap>
<Bitmap id="volume" file="volume.bmp" alphacolor="#FF0001">
<SubBitmap id="volume_bg" x="0" y="0" width="68" height="418" />
<SubBitmap id="volume_bg" x="0" y="0" width="65" height="418" />
<SubBitmap id="volume_up" x="15" y="422" width="14" height="11" />
<SubBitmap id="volume_down" x="0" y="422" width="14" height="11" />
</Bitmap>
<Font id="playlist_font" file="FreeSansBold.ttf" size="11" />
<BitmapFont id="digits_font" file="numbers.bmp" type="digits" />
<BitmapFont id="digits_font" file="nums_ex.bmp" type="digits" />
<BitmapFont id="digits_font" file="numbers.bmp" type="digits" />
<BitmapFont id="text_font" file="text.bmp" type="text" />
<Window id="main_window" x="100" y="100">