summaryrefslogtreecommitdiff
path: root/core/applets/volumeapplet/volume.cpp
Side-by-side diff
Diffstat (limited to 'core/applets/volumeapplet/volume.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/volumeapplet/volume.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp
index 942cebb..276f47f 100644
--- a/core/applets/volumeapplet/volume.cpp
+++ b/core/applets/volumeapplet/volume.cpp
@@ -18,56 +18,57 @@
**
**********************************************************************/
#include "volume.h"
#include "oledbox.h"
#include <opie2/odevice.h>
#include <opie2/otaskbarapplet.h>
#include <qpe/resource.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpainter.h>
#include <qcheckbox.h>
#include <qslider.h>
#include <qlayout.h>
#include <qvbox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qtimer.h>
#include <stdio.h>
-using namespace Opie;
+using namespace Opie::Core;
#define RATE_TIMER_INTERVAL 100
// Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time
// results in "hanging" buttons on the iPAQ due to quite high CPU consumption.
/* XPM */
+using namespace Opie::Ui;
static const char * vol_xpm[] = {
"20 20 3 1",
" c None",
". c #0000FF",
"+ c #000000",
" ",
" . ",
" . . . . ",
" . . . . . . ",
" . . . . . . . ",
" . . ..... . . ",
" . ... ..... ... ",
" ........... .... ",
" ................. ",
"++++++++++++++++++++",
" .................. ",
" . ............. . ",
" . ..... ....... ",
" . ... ..... . ",
" . ... ..... . ",
" . ... ..... ",
" . . . . . ",
" . . . ",
" . . . ",
@@ -756,28 +757,25 @@ void VolumeApplet::redraw ( bool all )
void VolumeApplet::paintEvent ( QPaintEvent * )
{
QPainter p ( this );
p. drawPixmap ( (width()- m_pixmap->width())/2, QMAX( (height()-4-m_pixmap->height() )/2, 1), *m_pixmap );
p. setPen ( darkGray );
p. drawRect ( 1, height() - 4, width() - 2, 4 );
int pixelsWide = m_dialog-> volPercent ( ) * ( width() - 4 ) / 100;
p. fillRect ( 2, height() - 3, pixelsWide, 2, red );
p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray );
if ( m_dialog-> volMuted ( )) {
p. setPen ( red );
p. drawLine ( 1, 2, width() - 2, height() - 5 );
p. drawLine ( 1, 3, width() - 2, height() - 4 );
p. drawLine ( width() - 2, 2, 1, height() - 5 );
p. drawLine ( width() - 2, 3, 1, height() - 4 );
}
}
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( OTaskbarAppletWrapper<VolumeApplet> );
-}
+EXPORT_OPIE_APPLET_v1( VolumeApplet )