implement activated() slot for Plasma::Icon

and use it in IconApplet

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=760054
This commit is contained in:
Marco Martin 2008-01-11 20:30:25 +00:00
parent f02a65c95e
commit 834ce37f54
2 changed files with 13 additions and 0 deletions

View File

@ -39,6 +39,7 @@
#include "effects/blur.cpp"
#endif
#include <KGlobalSettings>
#include <KIconEffect>
#include <KIconLoader>
#include <KIcon>
@ -1025,6 +1026,9 @@ void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if (!handled) {
if (boundingRect().contains(event->pos())) {
emit clicked();
if (KGlobalSettings::singleClick()) {
emit activated();
}
}
emit pressed(false);
}
@ -1035,6 +1039,9 @@ void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void Icon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
emit doubleClicked();
if (!KGlobalSettings::singleClick()) {
emit activated();
}
}
void Icon::hoverEnterEvent(QGraphicsSceneHoverEvent *event)

View File

@ -228,6 +228,12 @@ Q_SIGNALS:
*/
void doubleClicked();
/**
* Indicates when the icon has been activated following the single
* or doubleclick settings
*/
void activated();
protected:
bool isDown();
void mousePressEvent(QGraphicsSceneMouseEvent *event);