From 4fe87fcfea73f26be8ceb273556619514992fc8d Mon Sep 17 00:00:00 2001 From: Rob Scheepmaker Date: Sat, 22 Nov 2008 14:32:43 +0000 Subject: [PATCH] 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 --- private/extenderapplet.cpp | 6 +++--- private/extenderapplet_p.h | 4 ++-- servicetypes/plasma-applet-extenderapplet.desktop | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/private/extenderapplet.cpp b/private/extenderapplet.cpp index 3a7004266..3905f4536 100644 --- a/private/extenderapplet.cpp +++ b/private/extenderapplet.cpp @@ -25,9 +25,9 @@ #include 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(); } } diff --git a/private/extenderapplet_p.h b/private/extenderapplet_p.h index 6b49ab40e..ce5c9e290 100644 --- a/private/extenderapplet_p.h +++ b/private/extenderapplet_p.h @@ -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: diff --git a/servicetypes/plasma-applet-extenderapplet.desktop b/servicetypes/plasma-applet-extenderapplet.desktop index e4dc33539..5ce55ca21 100644 --- a/servicetypes/plasma-applet-extenderapplet.desktop +++ b/servicetypes/plasma-applet-extenderapplet.desktop @@ -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