summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-01-04 17:15:57 (UTC)
committer mickeyl <mickeyl>2004-01-04 17:15:57 (UTC)
commit7c358bb7f19991dff1fd0a68161b411bd808b280 (patch) (side-by-side diff)
treeac1eada9f68b545e854a3db68e010b3f0af0f77d
parentee46be7501081a10d744471582426db92ec22a9e (diff)
downloadopie-7c358bb7f19991dff1fd0a68161b411bd808b280.zip
opie-7c358bb7f19991dff1fd0a68161b411bd808b280.tar.gz
opie-7c358bb7f19991dff1fd0a68161b411bd808b280.tar.bz2
smoothscale to current resolution
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/networkapplet/networkapplet.cpp22
-rw-r--r--noncore/applets/networkapplet/networkapplet.h2
2 files changed, 17 insertions, 7 deletions
diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp
index 4e658da..9a08568 100644
--- a/noncore/applets/networkapplet/networkapplet.cpp
+++ b/noncore/applets/networkapplet/networkapplet.cpp
@@ -28,22 +28,27 @@
*/
#include "networkapplet.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <opie2/onetwork.h>
#include <opie2/otaskbarapplet.h>
+#include <qpe/applnk.h>
#include <qpe/qlibrary.h>
#include <qpe/resource.h>
#include <qpainter.h>
-#include <opie2/odebug.h>
-#include <opie2/onetwork.h>
-#include <qpushbutton.h>
+/* QT */
+#include <qhostaddress.h>
+#include <qimage.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
-#include <qtoolbutton.h>
-#include <qhostaddress.h>
#include <qobjectlist.h>
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
#include <assert.h>
IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name )
@@ -209,9 +214,12 @@ QSize NetworkAppletControl::sizeHint() const
NetworkApplet::NetworkApplet( QWidget *parent, const char *name )
:OTaskbarApplet( parent, name )
{
- _control = new NetworkAppletControl( this, "control" );
+ setFixedHeight( AppLnk::smallIconSize() );
+ setFixedWidth( AppLnk::smallIconSize() );
+ _pixmap.convertFromImage( Resource::loadImage( "networkapplet/network" ).smoothScale( height(), width() ) );
+ _control = new NetworkAppletControl( this, "control" );
}
NetworkApplet::~NetworkApplet()
@@ -227,9 +235,9 @@ int NetworkApplet::position()
void NetworkApplet::paintEvent( QPaintEvent* )
{
QPainter p(this);
- p.drawPixmap(0, 2, Resource::loadPixmap( "networkapplet/network" ) );
+ p.drawPixmap(0, 2, _pixmap );
}
void NetworkApplet::mousePressEvent( QMouseEvent* )
diff --git a/noncore/applets/networkapplet/networkapplet.h b/noncore/applets/networkapplet/networkapplet.h
index 7b5fa97..8022537 100644
--- a/noncore/applets/networkapplet/networkapplet.h
+++ b/noncore/applets/networkapplet/networkapplet.h
@@ -35,8 +35,9 @@
#include <qframe.h>
#include <qstring.h>
#include <qtoolbutton.h>
#include <qlineedit.h>
+#include <qpixmap.h>
class ONetworkInterface;
class QShowEvent;
class QHideEvent;
@@ -105,8 +106,9 @@ class NetworkApplet : public OTaskbarApplet
virtual void mousePressEvent( QMouseEvent* );
private:
NetworkAppletControl* _control;
+ QPixmap _pixmap;
};
#endif