[Panel-devel] [PATCH] Small "fixes"

Rafael Fernández López ereslibre at gmail.com
Fri Jul 13 13:59:06 CEST 2007


Hey,

Well as Aaron proposed on other mail, ExtenderItem is probably not needed,
and maybe is worth using directly Plasma::Applet. It is very annoying that I
haven't got time to work on this and commit it before august (or so). I'm
leaving for vacation and I won't have any laptop or whatever :(. If somebody
is going to work on this, please tell me, but I would like to give my whole
efforts when coming back, and probably for the beginning of August extenders
can be pretty "mature".

What I have noticed is that we need this changes for making it being drawn
correctly (for example when they are faked-drawn on a dragging event to
another extender, that they are painted with 50% of opacity). This makes
them being painted and being painted in the correct place.

I would like to know if I can commit this patch before leaving on 15 or 16
for interrail.


Bye and thanks !
Rafael Fernández López.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/panel-devel/attachments/20070713/a13599de/attachment.html 
-------------- next part --------------
Index: plasma/applets/url/url.cpp
===================================================================
--- plasma/applets/url/url.cpp	(revisi��n: 687353)
+++ plasma/applets/url/url.cpp	(copia de trabajo)
@@ -88,6 +88,11 @@ void Url::setUrl(const KUrl& url)
     m_icon->setIcon(KMimeType::iconNameForUrl(url));
 }
 
+void Url::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget)
+{
+    m_icon->paint(p, option, widget);
+}
+
 void Url::openUrl()
 {
     KUrl url = m_icon->url();
Index: plasma/applets/url/url.h
===================================================================
--- plasma/applets/url/url.h	(revisi��n: 687353)
+++ plasma/applets/url/url.h	(copia de trabajo)
@@ -43,6 +43,8 @@ class Url : public Plasma::Applet
         void constraintsUpdated();
         void setUrl(const KUrl& url);
 
+        void paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget);
+
     public slots:
         void propertiesDialog();
         void openUrl();
Index: plasma/applets/clock/clock.cpp
===================================================================
--- plasma/applets/clock/clock.cpp	(revisi��n: 687353)
+++ plasma/applets/clock/clock.cpp	(copia de trabajo)
@@ -182,6 +182,8 @@ void Clock::drawHand(QPainter *p, int ro
 
 void Clock::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget)
 {
+    p->translate(option->rect.topLeft());
+
     Q_UNUSED(option)
     Q_UNUSED(widget)
 
Index: libs/plasma/widgets/icon.cpp
===================================================================
--- libs/plasma/widgets/icon.cpp	(revisi��n: 687353)
+++ libs/plasma/widgets/icon.cpp	(copia de trabajo)
@@ -20,6 +20,7 @@
 
 #include <QPainter>
 #include <QGraphicsSceneMouseEvent>
+#include <QStyleOptionGraphicsItem>
 #include <QGraphicsView>
 
 //#define PROVE_IT_CAN_BE_DONE
@@ -160,6 +161,8 @@ QRectF Icon::boundingRect() const
 
 void Icon::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 {
+    painter->translate(option->rect.topLeft());
+
     Q_UNUSED(option)
     Q_UNUSED(widget)
     painter->save();


More information about the Panel-devel mailing list