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:
parent
f0a8b90f3d
commit
4fe87fcfea
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user