rendered paste body--- bball.cpp.orig 2008-01-16 10:47:20.000000000 +1000
+++ bball.cpp 2008-01-16 13:51:53.000000000 +1000
@@ -24,20 +24,21 @@
#include <QMessageBox>
#include <qdesktopwidget.h>
-
#include <plasma/svg.h>
#include <plasma/theme.h>
#include <plasma/phase.h>
+const int ball_size = 100;
+
using namespace Plasma;
bball::bball(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args),
- m_size(200,200),
+ m_size(ball_size, ball_size),
m_ball_svg("widgets/bball", this)
{
m_ball_svg.setContentType(Plasma::Svg::SingleImage);
- m_position = QRectF(100,100, 100, 100);
+ m_position = QRectF(ball_size, ball_size, ball_size, ball_size);
QDesktopWidget* desktop = new QDesktopWidget();
m_screen = desktop->availableGeometry();
@@ -119,6 +120,10 @@
void bball::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
{
+ Q_UNUSED(option);
+
+ setDrawStandardBackground(false);
+
p->setRenderHint(QPainter::SmoothPixmapTransform);
p->setRenderHint(QPainter::Antialiasing);
@@ -138,6 +143,8 @@
void bball::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
{
+ Q_UNUSED(event);
+
m_x_vel = (m_mouse - m_old_mouse).x();
m_y_vel = (m_mouse - m_old_mouse).y();
m_mouse_pressed = false;