summaryrefslogtreecommitdiff
path: root/core/applets
Side-by-side diff
Diffstat (limited to 'core/applets') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp10
-rw-r--r--core/applets/clipboardapplet/clipboard.cpp10
-rw-r--r--core/applets/irdaapplet/irda.cpp0
-rw-r--r--core/applets/irdaapplet/irdaappletimpl.h2
-rw-r--r--core/applets/rotateapplet/rotate.h2
-rw-r--r--core/applets/volumeapplet/volume.cpp2
6 files changed, 20 insertions, 6 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index 078ce8d..15eb762 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -25,42 +25,45 @@
#include <qpe/power.h>
#include <qpe/qpeapplication.h>
#include <qpainter.h>
#include <qtimer.h>
BatteryMeter::BatteryMeter( QWidget *parent )
: QWidget( parent ), charging(false)
{
ps = new PowerStatus;
startTimer( 10000 );
+
+ setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) );
setFixedHeight( AppLnk::smallIconSize() );
+
chargeTimer = new QTimer( this );
connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) );
timerEvent(0);
QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
Config c( "qpe" );
c.setGroup( "Battery" );
style = c.readNumEntry( "Style", 0 );
}
BatteryMeter::~BatteryMeter()
{
delete ps;
}
QSize BatteryMeter::sizeHint() const
{
- return QSize(10, height() );
+ return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() );
}
void BatteryMeter::mousePressEvent( QMouseEvent* e )
{
if ( e->button() == RightButton )
{
style = 1-style;
Config c( "qpe" );
c.setGroup( "Battery" );
c.writeEntry( "Style", style );
repaint( true );
}
@@ -107,32 +110,33 @@ void BatteryMeter::chargeTimeout()
{
percent += 20;
if ( percent > 100 )
percent = 0;
repaint(FALSE);
if ( batteryView )
batteryView->updatePercent( percent );
}
void BatteryMeter::paintEvent( QPaintEvent* )
{
+ qWarning("paint");
if ( style == 1 )
{
QPainter p(this);
QFont f( "Fixed", AppLnk::smallIconSize()/2 );
QFontMetrics fm( f );
p.setFont( f );
- p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) );
- p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" );
+ p.drawText( 0, height()/2, QString::number( percent ) );
+ p.drawText( width()/4, height(), "%" );
return;
}
QPainter p(this);
QColor color;
QColor g = gray.light( 160 );
switch ( ps->acStatus() )
{
case PowerStatus::Offline: color = blue.light( 150 ); break;
case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break;
default: color = red.light( 160 );
}
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp
index 21b68e3..bb0db9b 100644
--- a/core/applets/clipboardapplet/clipboard.cpp
+++ b/core/applets/clipboardapplet/clipboard.cpp
@@ -28,25 +28,29 @@
#include <qwindowsystem_qws.h>
#include <qapplication.h>
#include <qclipboard.h>
#include <qtimer.h>
//===========================================================================
ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name )
{
setFixedWidth ( AppLnk::smallIconSize() );
setFixedHeight ( AppLnk::smallIconSize() );
- m_clipboardPixmap = QPixmap ( Resource::loadPixmap( "paste" ) );
+
+ QImage img = Resource::loadImage( "paste");
+ img = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
+
+ m_clipboardPixmap.convertFromImage( img );
m_timer = new QTimer ( this );
connect ( QApplication::clipboard ( ), SIGNAL( dataChanged ( )), this, SLOT( newData ( )));
connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( newData ( )));
connect ( qApp, SIGNAL( aboutToQuit ( )), this, SLOT( shutdown ( )));
m_menu = 0;
m_dirty = true;
m_lasttext = QString::null;
m_timer-> start ( 0, true );
@@ -131,25 +135,27 @@ void ClipboardApplet::action(int id)
break;
}
if ( scan ) {
qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, true, false );
qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, false, false );
}
}
void ClipboardApplet::paintEvent ( QPaintEvent* )
{
QPainter p ( this );
- p. drawPixmap( 0, 1, m_clipboardPixmap );
+ /* center the height but our pixmap is as big as the height ;)*/
+ p. drawPixmap( 0, 0,
+ m_clipboardPixmap );
}
void ClipboardApplet::newData ( )
{
static bool excllock = false;
if ( excllock )
return;
else
excllock = true;
m_timer-> stop ( );
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp
index 51c2ebf..f850424 100644
--- a/core/applets/irdaapplet/irda.cpp
+++ b/core/applets/irdaapplet/irda.cpp
diff --git a/core/applets/irdaapplet/irdaappletimpl.h b/core/applets/irdaapplet/irdaappletimpl.h
index ef0c5a6..f9e855a 100644
--- a/core/applets/irdaapplet/irdaappletimpl.h
+++ b/core/applets/irdaapplet/irdaappletimpl.h
@@ -11,24 +11,26 @@
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef IRDAAPPLETIMPL_H
#define IRDAAPPLETIMPL_H
+#include <qwidget.h>
+
#include <qpe/taskbarappletinterface.h>
class IrdaApplet;
class IrdaAppletImpl : public TaskbarAppletInterface
{
public:
IrdaAppletImpl();
virtual ~IrdaAppletImpl();
QRESULT queryInterface( const QUuid&, QUnknownInterface** );
Q_REFCOUNT
diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h
index 5ac7768..de2a707 100644
--- a/core/applets/rotateapplet/rotate.h
+++ b/core/applets/rotateapplet/rotate.h
@@ -25,24 +25,26 @@
Boston, MA 02111-1307, USA.
*/
#ifndef __OPIE_ROTATE_APPLET_H__
#define __OPIE_ROTATE_APPLET_H__
#include <qpe/menuappletinterface.h>
#include <qobject.h>
+#include <qobject.h>
+
class RotateApplet : public QObject, public MenuAppletInterface
{
Q_OBJECT
public:
RotateApplet ( );
virtual ~RotateApplet ( );
QRESULT queryInterface( const QUuid&, QUnknownInterface** );
Q_REFCOUNT
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp
index b129be3..38f827e 100644
--- a/core/applets/volumeapplet/volume.cpp
+++ b/core/applets/volumeapplet/volume.cpp
@@ -754,25 +754,25 @@ void VolumeApplet::redraw ( bool all )
{
if ( all )
repaint ( true );
else
repaint ( 2, height ( ) - 3, width ( ) - 4, 2, false );
}
void VolumeApplet::paintEvent ( QPaintEvent * )
{
QPainter p ( this );
- p. drawPixmap ( 0, 1, *m_pixmap );
+ 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 );