Re: unitconverter applet moved to kdereview

2009-02-25 Thread Petri Damstén
On Friday 06 February 2009 13:46:02 Petri Damstén wrote:
> Hi,
>
> I moved unitconverter applet to kdereview. It now uses the same conversion
> lib that converter runner does, but some might like to do their conversions
> in an applet.

unitconverter has now been in kdereview for two weeks. ok to move to 
kdeplasma-addons?

Petri



signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: [patch] fix crasher in applethandle

2009-02-25 Thread Sebastian Kügler
On Monday 23 February 2009 01:59:39 Sebastian Kügler wrote:
> Can somebody quickly review this patch?
>
> I'm dragging data from an applet (emailmessage in this case) onto the
> desktop, a note is created, clicking on its applet handle makes
> plasmoidviewer crash (bt attached). I've played around with the patch
> applied and didn't notice any side effects, besides plasmoidviewer not
> exploding in my face. :>
> It seems that m_currentView for that D+D'ed applet isn't there, and it
> doesn't seem to be a problem on the desktop, just in plasmoidviewer.
>
> Is this OK to commit?

Committed. Shout if it gives you a headache.
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 



signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request: Comic applet using Plasma::Widgets

2009-02-25 Thread Matthias Fuchs

---
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/145/
---

(Updated 2009-02-25 13:30:49.350947)


Review request for Plasma.


Changes
---

ArrowWidget emits clicked() on left click, added Stretch to the bottomLayout


Summary
---

I converted the comic applet to use Plasma::Widgets and basically everything 
works nice.

I have some questions though:

* Is there a way to avoid recreating the layout (ComicApplet::createLayout() in 
this case )?
* Is there a way to add SpacerItems, so that mLabelId would be on the left of 
bottomLayout and only use as much space as needed, while mLabelUrl would be on 
the right and only use as much space needed as well?


Diffs (updated)
-

  /trunk/KDE/kdeplasma-addons/applets/comic/CMakeLists.txt 930543 
  /trunk/KDE/kdeplasma-addons/applets/comic/arrowwidget.h PRE-CREATION 
  /trunk/KDE/kdeplasma-addons/applets/comic/arrowwidget.cpp PRE-CREATION 
  /trunk/KDE/kdeplasma-addons/applets/comic/comic.h 931593 
  /trunk/KDE/kdeplasma-addons/applets/comic/comic.cpp 931593 
  /trunk/KDE/kdeplasma-addons/applets/comic/imagewidget.h PRE-CREATION 
  /trunk/KDE/kdeplasma-addons/applets/comic/imagewidget.cpp PRE-CREATION 

Diff: http://reviewboard.kde.org/r/145/diff


Testing
---

Works fine.


Thanks,

Matthias

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Review Request: qwidget for monitor previews

2009-02-25 Thread Marco Martin

---
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/187/
---

Review request for Plasma.


Summary
---

it's a qwidget that rapresent the monitor for wallpaper previews, i'm putting 
it public because it's used also by the screensaver kcm and in two places in 
the login manager, and the picture frame.
but i'm also not very happy adding stuff in the plasma namespace, so here the 
Plasma::Util namespace (sadly some stuff in Plasma:: would make more sense here 
but it's too late, oh, well...)

will add apidocs :)


Diffs
-

  /trunk/KDE/kdelibs/plasma/CMakeLists.txt 930878 
  /trunk/KDE/kdelibs/plasma/util/screenwidget.h PRE-CREATION 
  /trunk/KDE/kdelibs/plasma/util/screenwidget.cpp PRE-CREATION 

Diff: http://reviewboard.kde.org/r/187/diff


Testing
---

wallpapers settings and screensaver for now


Screenshots
---


  http://reviewboard.kde.org/r/187/s/33/


Thanks,

Marco

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Plasma themed tabbox

2009-02-25 Thread Marco Martin
On Tuesday 24 February 2009, Martin Gräßlin wrote:
> I worked on Plasma themeing the normal tabbox (without effects). So far
> everything seems to work ;-)
>
> As this is my first work on anything related to QGraphicsView/Plasma I
> cc-ed Plasma devs. Please have a look at the patch and tell me what I have
> done wrong (probably thousands of things). Especially there is still a
> white border around the tabbox and I don't know how to get rid of it.

setAttribute(Qt::WA_TranslucentBackground) on the widget, and then
painter->setCompositionMode(QPainter::CompositionMode_Source) before 
painting the framesvg

> The old tabbox highlights the background of the active item. I decided to
> just change the font of the item (underline and bold) and apply an icon
> effect. I don't know if it is enough to indicate the currently selected
> item.
>
> Minimized windows used to have a different color. Here I choose an italic
> font instead. Icon effect still the same.
>
> Here some screenshots:
>  * http://img7.imageshack.us/img7/4466/plasmatabbox.png
>  * http://img25.imageshack.us/img25/9282/plasmadesktopbox.png
>
> Regards
> Martin


___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Plasma themed tabbox

2009-02-25 Thread Sebastian Kügler
On Tuesday 24 February 2009 12:20:06 Martin Gräßlin wrote:
> I worked on Plasma themeing the normal tabbox (without effects). So far
> everything seems to work ;-)
>
> As this is my first work on anything related to QGraphicsView/Plasma I
> cc-ed Plasma devs. Please have a look at the patch and tell me what I have
> done wrong (probably thousands of things). Especially there is still a
> white border around the tabbox and I don't know how to get rid of it.

The Plasma theme provides two sorts of graphics, one for composited (with 
smooth edges and translucent shadow) and one for non-composited, which are a 
bit more pixelised. The dialog in your screenshot looks like it's using the 
plasma theme's graphics for compositing enabled while the window doesn't have 
translucency available (konsole apparently has) and thus paints those areas 
white -- that's the shadow on the white border then.

> The old tabbox highlights the background of the active item. I decided to
> just change the font of the item (underline and bold) and apply an icon
> effect. I don't know if it is enough to indicate the currently selected
> item.
>
> Minimized windows used to have a different color. Here I choose an italic
> font instead. Icon effect still the same.

The Plasma theme for the tasks widgets has these highlighted window button, 
that should work well visually with the taskbar (which essentially is another 
window switcher).

> Here some screenshots:
>  * http://img7.imageshack.us/img7/4466/plasmatabbox.png
>  * http://img25.imageshack.us/img25/9282/plasmadesktopbox.png

Really nice :-)
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 












signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: plasma-desktop not automatically started in trunk

2009-02-25 Thread Andreas Pakulat
On 25.02.09 17:37:04, Andreas Pakulat wrote:
> Hi,
> 
> it seems that recent trunk doesn't auto start plasma-desktop anymore, at
> least here it doesn't. My build is probably about 2 days old, so if I just
> need to svn up ignore this mail as I'm going to do that later tonight.
> 
> In the case I'm not alone with this: How should I debug whats going wrong?
> Where do I best start? I didn't touch startkde4 so thats probably not the
> culprit.

This apparently also affects krunner.

Oh and I'm not subscribed to the list so I'd appreciate it if you could Cc
me on replies.

Andreas

-- 
You will be successful in love.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


plasma-desktop not automatically started in trunk

2009-02-25 Thread Andreas Pakulat
Hi,

it seems that recent trunk doesn't auto start plasma-desktop anymore, at
least here it doesn't. My build is probably about 2 days old, so if I just
need to svn up ignore this mail as I'm going to do that later tonight.

In the case I'm not alone with this: How should I debug whats going wrong?
Where do I best start? I didn't touch startkde4 so thats probably not the
culprit.

Andreas

-- 
"Life, loathe it or ignore it, you can't like it."
-- Marvin, "Hitchhiker's Guide to the Galaxy"
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Fun with Akonadi Dataeng

2009-02-25 Thread David Baron
Any progress on the akonadi engine? (I have been offline a few days because I 
l lost my geforce).

Last svn I took crashed the engine-explorer and my applet so I doubt it is my 
code. Could it be that dataUpdated() was being exercised with invalid or null 
data? Since the receives Plasma::DataEngine::Data&, how would one check this 
to be safe?
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request: Comic applet using Plasma::Widgets

2009-02-25 Thread Matthias Fuchs

---
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/145/
---

(Updated 2009-02-25 04:36:47.924343)


Review request for Plasma.


Summary
---

I converted the comic applet to use Plasma::Widgets and basically everything 
works nice.

I have some questions though:

* Is there a way to avoid recreating the layout (ComicApplet::createLayout() in 
this case )?
* Is there a way to add SpacerItems, so that mLabelId would be on the left of 
bottomLayout and only use as much space as needed, while mLabelUrl would be on 
the right and only use as much space needed as well?


Diffs (updated)
-

  /trunk/KDE/kdeplasma-addons/applets/comic/CMakeLists.txt 930543 
  /trunk/KDE/kdeplasma-addons/applets/comic/arrowwidget.h PRE-CREATION 
  /trunk/KDE/kdeplasma-addons/applets/comic/arrowwidget.cpp PRE-CREATION 
  /trunk/KDE/kdeplasma-addons/applets/comic/comic.h 930543 
  /trunk/KDE/kdeplasma-addons/applets/comic/comic.cpp 930543 
  /trunk/KDE/kdeplasma-addons/applets/comic/imagewidget.h PRE-CREATION 
  /trunk/KDE/kdeplasma-addons/applets/comic/imagewidget.cpp PRE-CREATION 

Diff: http://reviewboard.kde.org/r/145/diff


Testing
---

Works fine.


Thanks,

Matthias

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request: Comic applet using Plasma::Widgets

2009-02-25 Thread Matthias Fuchs

---
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/145/
---

(Updated 2009-02-25 04:34:58.634432)


Review request for Plasma.


Changes
---

The applet is working fine. Should I commit?


Summary (updated)
---

I converted the comic applet to use Plasma::Widgets and basically everything 
works nice.

I have some questions though:

* Is there a way to avoid recreating the layout (ComicApplet::createLayout() in 
this case )?
* Is there a way to add SpacerItems, so that mLabelId would be on the left of 
bottomLayout and only use as much space as needed, while mLabelUrl would be on 
the right and only use as much space needed as well?


Diffs (updated)
-

  KDE/kdeplasma-addons/applets/comic/CMakeLists.txt 930543 
  KDE/kdeplasma-addons/applets/comic/arrowwidget.h PRE-CREATION 
  KDE/kdeplasma-addons/applets/comic/arrowwidget.cpp PRE-CREATION 
  KDE/kdeplasma-addons/applets/comic/comic.h 930543 
  KDE/kdeplasma-addons/applets/comic/comic.cpp 930543 
  KDE/kdeplasma-addons/applets/comic/imagewidget.h PRE-CREATION 
  KDE/kdeplasma-addons/applets/comic/imagewidget.cpp PRE-CREATION 

Diff: http://reviewboard.kde.org/r/145/diff


Testing (updated)
---

Works fine.


Thanks,

Matthias

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request: Comic applet using Plasma::Widgets

2009-02-25 Thread Matthias Fuchs


> On 2009-02-21 08:43:04, Aaron Seigo wrote:
> > KDE/kdeplasma-addons/applets/comic/imagewidget.cpp, line 29
> > 
> >
> > this should probably have setCacheMode(DeviceCoordinateCache) set on it 
> > for performance purposes.

Sometimes the image (after setImage) is not rerendered. What to do to avoid 
that?


- Matthias


---
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/145/#review216
---


On 2009-02-25 04:34:58, Matthias Fuchs wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/145/
> ---
> 
> (Updated 2009-02-25 04:34:58)
> 
> 
> Review request for Plasma.
> 
> 
> Summary
> ---
> 
> I converted the comic applet to use Plasma::Widgets and basically everything 
> works nice.
> 
> I have some questions though:
> 
> * Is there a way to avoid recreating the layout (ComicApplet::createLayout() 
> in this case )?
> * Is there a way to add SpacerItems, so that mLabelId would be on the left of 
> bottomLayout and only use as much space as needed, while mLabelUrl would be 
> on the right and only use as much space needed as well?
> 
> 
> Diffs
> -
> 
>   KDE/kdeplasma-addons/applets/comic/CMakeLists.txt 930543 
>   KDE/kdeplasma-addons/applets/comic/arrowwidget.h PRE-CREATION 
>   KDE/kdeplasma-addons/applets/comic/arrowwidget.cpp PRE-CREATION 
>   KDE/kdeplasma-addons/applets/comic/comic.h 930543 
>   KDE/kdeplasma-addons/applets/comic/comic.cpp 930543 
>   KDE/kdeplasma-addons/applets/comic/imagewidget.h PRE-CREATION 
>   KDE/kdeplasma-addons/applets/comic/imagewidget.cpp PRE-CREATION 
> 
> Diff: http://reviewboard.kde.org/r/145/diff
> 
> 
> Testing
> ---
> 
> Works fine.
> 
> 
> Thanks,
> 
> Matthias
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: How to adjust applet size according to its child QGraphicsWidget?

2009-02-25 Thread Alexis Ménard
Ok,

I found the problem. Nowhere you set the size of MyGraphicsWidget, so the
layout can't know about its size, and more you never set the preferredSize
so it use the default which is arbitrary small. Take a look on the doc for
setPreferredSize, setMinimumSize, setMaximumSize and the overload of
sizeHint for custom sizeHints.

Btw :

QSizeF s = parentWidget()->size()

That is not a good approach in the paint event.

2009/2/25 Petri Damstén 

> On Wednesday 25 February 2009 12:05:52 Dong Tiger wrote:
> > 2008/12/30 Alexis Ménard 
> >
> > > Unfortunately you can't it is a bug in Qt.
> > >
> > > You can take a look to the task tracker of Qt Number 231114 and 211500.
> I
> > > guess it is what you try to solve. The fix is in 4.4 branch (so
> scheduled
> > > for 4.4.4) and in 4.5.
> >
> > I still can't get this work even with latest Qt4.5. I've attached code of
> a
> > sample plasmoid which demonstrate the problem. You are welcomed to try it
> > out. Right click on the applet to modify its child widget size.
> >
> > > As a workaround you have to manage the resize of your applet by hand
> when
> > > the size of the layout change.
> >
> > The question is how can I do it? When the embedded QGraphicsWidget need
> to
> > enlarge, say from 200x200 to 400x400, how can I decide what the applet
> size
> > should be?
>
> Does this work?
>
> Petri
>
>
> ___
> Plasma-devel mailing list
> Plasma-devel@kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
>
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: How to adjust applet size according to its child QGraphicsWidget?

2009-02-25 Thread Petri Damstén
On Wednesday 25 February 2009 12:05:52 Dong Tiger wrote:
> 2008/12/30 Alexis Ménard 
>
> > Unfortunately you can't it is a bug in Qt.
> >
> > You can take a look to the task tracker of Qt Number 231114 and 211500. I
> > guess it is what you try to solve. The fix is in 4.4 branch (so scheduled
> > for 4.4.4) and in 4.5.
>
> I still can't get this work even with latest Qt4.5. I've attached code of a
> sample plasmoid which demonstrate the problem. You are welcomed to try it
> out. Right click on the applet to modify its child widget size.
>
> > As a workaround you have to manage the resize of your applet by hand when
> > the size of the layout change.
>
> The question is how can I do it? When the embedded QGraphicsWidget need to
> enlarge, say from 200x200 to 400x400, how can I decide what the applet size
> should be?

Does this work?

Petri

#include "plasma-tutorial1.h"
#include 
#include 
#include 

#include 
#include 
#include 
QSizePolicy::Policy policy = QSizePolicy::Preferred;

class MyGraphicsWidget: public QGraphicsWidget {
 public:
  MyGraphicsWidget(QGraphicsItem * parent = 0) : QGraphicsWidget(parent) {}
  void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) {
QRectF r = rect();
p->setPen(QColor(0, 0, 255));
p->drawLine(r.left(), r.top(), r.right(), r.bottom());
p->drawLine(r.left(), r.bottom(), r.right(), r.top());
p->drawRect(r);
QSizeF s = parentWidget()->size();
p->drawText(10, 10, QString("Child:%1x%2").arg(size().width()).arg(size().height()));
p->drawText(10, 30, QString("Parent:%1x%2").arg(s.width()).arg(s.height()));
  }
};

static void embedWidget(QGraphicsWidget *parent, QWidget *widget) {
}

PlasmaTutorial1::PlasmaTutorial1(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args), layout_(NULL), child_(NULL)
{
resize(200, 200);
child_ = new MyGraphicsWidget(this);
  layout_ = new QGraphicsLinearLayout(this);
  layout_->setSpacing(0);
  layout_->setContentsMargins(0, 0, 0, 0);
  layout_->addItem(child_);
  layout_->setSizePolicy(policy, policy);
  setLayout(layout_);

  setBackgroundHints(Plasma::Applet::NoBackground);
}


PlasmaTutorial1::~PlasmaTutorial1()
{
if (hasFailedToLaunch()) {
// Do some cleanup here
} else {
// Save settings
}
}

void PlasmaTutorial1::init()
{
}

void PlasmaTutorial1::paintInterface(QPainter *p,
const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
{
}

void PlasmaTutorial1::constraintsEvent(Plasma::Constraints constraints) {
  kDebug() << "constraintsEvent";
}
void PlasmaTutorial1::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
  QSize s = child_->size().toSize();

  int size = QInputDialog::getInteger(NULL, "Set Size", "Set size",
  s.width()*1000 + s.height());
  if (size == s.width()*1000 + s.height()) return;
  
  resize(QSizeF(size/1000, size%1000) + (rect().size() - contentsRect().size()));
}

#include "plasma-tutorial1.moc"


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request: Let PopupApplet show BusyWidget in popup

2009-02-25 Thread Artur de Souza (MoRpHeUz)

---
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/177/#review263
---



/trunk/KDE/kdelibs/plasma/applet.cpp


Hmm..this is also leaking during applet execution...need to fix this.


- Artur


On 2009-02-24 17:49:06, Artur de Souza (MoRpHeUz) wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/177/
> ---
> 
> (Updated 2009-02-24 17:49:06)
> 
> 
> Review request for Plasma and Aaron Seigo.
> 
> 
> Summary
> ---
> 
> Right now, PopupApplet can't show BusyWidget because it uses the applet's 
> boundingRect. To make it work inside the popup of PopupApplet, we need to 
> change some code inside Plasma::Applet to test if we have
> popup and if this is true, if we should use widget() or graphicsWidget().
> 
> 
> Diffs
> -
> 
>   /trunk/KDE/kdelibs/plasma/applet.cpp 929009 
> 
> Diff: http://reviewboard.kde.org/r/177/diff
> 
> 
> Testing
> ---
> 
> 
> Screenshots
> ---
> 
> busywidget
>   http://reviewboard.kde.org/r/177/s/30/
> 
> 
> Thanks,
> 
> Artur
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: How to adjust applet size according to its child QGraphicsWidget?

2009-02-25 Thread Dong Tiger
2008/12/30 Alexis Ménard 

> Unfortunately you can't it is a bug in Qt.
>
> You can take a look to the task tracker of Qt Number 231114 and 211500. I
> guess it is what you try to solve. The fix is in 4.4 branch (so scheduled
> for 4.4.4) and in 4.5.


I still can't get this work even with latest Qt4.5. I've attached code of a
sample plasmoid which demonstrate the problem. You are welcomed to try it
out. Right click on the applet to modify its child widget size.


>
>
> As a workaround you have to manage the resize of your applet by hand when
> the size of the layout change.
>
The question is how can I do it? When the embedded QGraphicsWidget need to
enlarge, say from 200x200 to 400x400, how can I decide what the applet size
should be?


>
> 2008/12/30 Dong Tiger 
>
>> Hi,
>>
>> A QGraphicsWidget is embeded into Plasma::Applet through
>> QGraphicsLinearLayout. When this QGraphicsWidget's size changes, how to get
>> the applet's size adjusted accordingly?
>>
>> The code snippet looks like:
>>
>>   child = new MyGraphicsWidget(applet);
>>   layout = new QGraphicsLinearLayout(applet);
>>   layout->setSpacing(0);
>>   layout->addItem(child);
>>   applet->setLayout(layout);
>>
>>
>> Regards,
>> --
>> Tiger
>>
>> ___
>> Plasma-devel mailing list
>> Plasma-devel@kde.org
>> https://mail.kde.org/mailman/listinfo/plasma-devel
>>
>>
>
> ___
> Plasma-devel mailing list
> Plasma-devel@kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
>
# Project Needs a name ofcourse
project(plasma-tutorial1)
 
# Find the required Libaries
find_package(Qt4 REQUIRED)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
 
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(
   ${CMAKE_SOURCE_DIR}
   ${CMAKE_BINARY_DIR}
   ${KDE4_INCLUDES}
   ${Qt4_INCLUDES}}
   )
 
# We add our source code here
set(tutorial1_SRCS plasma-tutorial1.cpp)
 
# Now make sure all files get to the right place
kde4_add_plugin(plasma_applet_tutorial1 ${tutorial1_SRCS})
target_link_libraries(plasma_applet_tutorial1 
  ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${Qt4_LIBS})
 
install(TARGETS plasma_applet_tutorial1
DESTINATION ${PLUGIN_INSTALL_DIR})
 
install(FILES plasma-applet-tutorial1.desktop
DESTINATION ${SERVICES_INSTALL_DIR})
#include "plasma-tutorial1.h"
#include 
#include 
#include 

#include 
#include 
#include 
QSizePolicy::Policy policy = QSizePolicy::Preferred;

class MyGraphicsWidget: public QGraphicsWidget {
 public:
  MyGraphicsWidget(QGraphicsItem * parent = 0) : QGraphicsWidget(parent) {}
  void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) {
QRectF r = rect();
p->setPen(QColor(0, 0, 255));
p->drawLine(r.left(), r.top(), r.right(), r.bottom());
p->drawLine(r.left(), r.bottom(), r.right(), r.top());
p->drawRect(r);
QSizeF s = parentWidget()->size();
p->drawText(10, 10, QString("Child:%1x%2").arg(size().width()).arg(size().height()));
p->drawText(10, 30, QString("Parent:%1x%2").arg(s.width()).arg(s.height()));
  }
};

static void embedWidget(QGraphicsWidget *parent, QWidget *widget) {
}

PlasmaTutorial1::PlasmaTutorial1(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args), layout_(NULL), child_(NULL)
{
resize(200, 200);
child_ = new MyGraphicsWidget(this);
  layout_ = new QGraphicsLinearLayout(this);
  layout_->setSpacing(0);
  layout_->addItem(child_);
  layout_->setSizePolicy(policy, policy);
  setLayout(layout_);

  setBackgroundHints(Plasma::Applet::NoBackground);
}


PlasmaTutorial1::~PlasmaTutorial1()
{
if (hasFailedToLaunch()) {
// Do some cleanup here
} else {
// Save settings
}
}

void PlasmaTutorial1::init()
{
}

void PlasmaTutorial1::paintInterface(QPainter *p,
const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
{
}

void PlasmaTutorial1::constraintsEvent(Plasma::Constraints constraints) {
  kDebug() << "constraintsEvent";
}
void PlasmaTutorial1::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
  QSize s = child_->size().toSize();

  int size = QInputDialog::getInteger(NULL, "Set Size", "Set size",
  s.width()*1000 + s.height());
  if (size == s.width()*1000 + s.height()) return;
  child_->resize(size/1000, size%1000);
  child_->setPreferredSize(size/1000, size%1000);
  // child_->setMinimumSize(size/1000, size%1000);
  setPreferredSize(layout_->preferredSize());
  updateGeometry();
  kDebug() << "mouseDoubleClickEvent";
}
#include "plasma-tutorial1.moc"
#ifndef Tutorial1_HEADER
#define Tutorial1_HEADER
// We need the Plasma Applet headers
#include 

#include 
#include 

#include 

class QSizeF;

// Define our plasma Applet
class PlasmaTutorial1 : public Plasma::Applet
{
Q_OBJECT
public:
// Basic Create/Destroy
PlasmaTutorial1(QObject *parent, const QVariantList &args);
  

Re: Review Request: Let PopupApplet show BusyWidget in popup

2009-02-25 Thread Marco Martin

---
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/177/#review260
---


that's a god thing.
however, does it react to applet resize when is in a popup?
looking at it it remembers me that i must do a similar thing with config 
overlays, perhaps the busy widget could be put in a massage overlay an let a 
layout manage it, so the work would be done a single time? just a random idea

- Marco


On 2009-02-24 17:49:06, Artur de Souza (MoRpHeUz) wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/177/
> ---
> 
> (Updated 2009-02-24 17:49:06)
> 
> 
> Review request for Plasma and Aaron Seigo.
> 
> 
> Summary
> ---
> 
> Right now, PopupApplet can't show BusyWidget because it uses the applet's 
> boundingRect. To make it work inside the popup of PopupApplet, we need to 
> change some code inside Plasma::Applet to test if we have
> popup and if this is true, if we should use widget() or graphicsWidget().
> 
> 
> Diffs
> -
> 
>   /trunk/KDE/kdelibs/plasma/applet.cpp 929009 
> 
> Diff: http://reviewboard.kde.org/r/177/diff
> 
> 
> Testing
> ---
> 
> 
> Screenshots
> ---
> 
> busywidget
>   http://reviewboard.kde.org/r/177/s/30/
> 
> 
> Thanks,
> 
> Artur
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel