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:
parent
f02a65c95e
commit
834ce37f54
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user