Avoid screwing up the panel when dropping extenderitems in it: make extenderapplet a popupapplet! And use pinheiro's nice and amazingly weird icon as popupicon. I think I'm gonna call it 'the snowman'.

svn path=/trunk/KDE/kdelibs/; revision=887651
This commit is contained in:
Rob Scheepmaker 2008-11-22 14:32:43 +00:00
parent f0a8b90f3d
commit 4fe87fcfea
3 changed files with 6 additions and 5 deletions

View File

@ -25,9 +25,9 @@
#include <QGraphicsLinearLayout>
ExtenderApplet::ExtenderApplet(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args)
: Plasma::PopupApplet(parent, args)
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
setPopupIcon("utilities-desktop-extra");
}
ExtenderApplet::~ExtenderApplet()
@ -52,7 +52,7 @@ void ExtenderApplet::init()
void ExtenderApplet::itemDetached(Plasma::ExtenderItem *)
{
if (!extender()->attachedItems().count()) {
if (extender()->attachedItems().isEmpty()) {
destroy();
}
}

View File

@ -20,14 +20,14 @@
#ifndef EXTENDERAPPLET_H
#define EXTENDERAPPLET_H
#include "applet.h"
#include "popupapplet.h"
/**
* This class is used as a 'host' for detached extender items. When an extender item is dropped
* somewhere, this applet is added at the location where the item is dropped, and the item is added
* to it's extender.
*/
class ExtenderApplet : public Plasma::Applet
class ExtenderApplet : public Plasma::PopupApplet
{
Q_OBJECT
public:

View File

@ -22,6 +22,7 @@ Name[x-test]=xxInternal Extender Containerxx
Name[zh_CN]=
Name[zh_TW]=
Type=Service
Icon=utilities-desktop-extra
X-KDE-ServiceTypes=Plasma/Applet
X-KDE-PluginInfo-Name=internal:extender
X-KDE-PluginInfo-EnabledByDefault=false