From a9015ff25ddec67983f78f2a75346f21b7d062c5 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 09 Dec 2002 21:29:21 +0000 Subject: - the skin loading code is now centralized. no more duplicated code :) --- (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 4901e47..d1efaad 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -94,30 +94,7 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye imgUp = QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); imgDn = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); - buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); - buttonMask.fill( 0 ); - - for ( uint i = 0; i < buttonCount; i++ ) { - Button button; - button.command = skinInfo[ i ].command; - button.type = skinInfo[ i ].type; - - QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_" + skinInfo[i].fileName + ".png" ); - button.mask =QBitmap( filename ); - - if ( !button.mask.isNull() ) { - QImage imgMask = button.mask.convertToImage(); - uchar **dest = buttonMask.jumpTable(); - for ( int y = 0; y < imgUp.height(); y++ ) { - uchar *line = dest[y]; - for ( int x = 0; x < imgUp.width(); x++ ) - if ( !qRed( imgMask.pixel( x, y ) ) ) - line[x] = button.command + 1; - } - } - - buttons.push_back( button ); - } + setupButtons( skinInfo, buttonCount, QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_", imgUp.size() ); setBackgroundPixmap( backgroundPixmap ); -- cgit v0.9.0.2