]> git.sesse.net Git - vlc/commitdiff
* winamp2.xml: support smaller volume bars (65 pixels instead of 68)
authorCyril Deguet <asmax@videolan.org>
Sun, 13 Nov 2005 12:12:25 +0000 (12:12 +0000)
committerCyril Deguet <asmax@videolan.org>
Sun, 13 Nov 2005 12:12:25 +0000 (12:12 +0000)
* 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)

modules/gui/skins2/parser/builder.cpp
modules/gui/skins2/parser/skin_parser.cpp
share/skins2/winamp2.xml

index 8e1cce8820e46ce7e748574aec2a9ac2e1d03eb0..fafaab89ad552d81c269c3e9b08a4174d0556aa2 100644 (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 );
index 9c8a5862ed6e7205bfd392e7b98d0e61be9aaba3..815902ba3da497447a4be11d67fe7d8fe80d55fd 100644 (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 );
index 3e8508227a591700c5c73935c4eccc7fe6d49bd4..8416988572fed849b44db333615b05bf146b18d0 100644 (file)
     </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">