Shrink the icon correctly on mouse clicks with respect to the global single/double-click mouse settings.

REVIEW:103831
This commit is contained in:
Ignat Semenov 2012-02-01 16:39:25 +04:00
parent 64f687dda0
commit 148002cee4

View File

@ -1372,7 +1372,9 @@ void IconWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
return; return;
} }
d->states |= IconWidgetPrivate::PressedState; if (KGlobalSettings::singleClick() || (receivers(SIGNAL(clicked()))) > 0) {
d->states |= IconWidgetPrivate::PressedState;
}
d->clickStartPos = scenePos(); d->clickStartPos = scenePos();
bool handled = false; bool handled = false;
@ -1451,10 +1453,14 @@ void IconWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{ {
Q_UNUSED(event) Q_UNUSED(event)
d->states |= IconWidgetPrivate::PressedState;
emit doubleClicked(); emit doubleClicked();
if (!KGlobalSettings::singleClick()) { if (!KGlobalSettings::singleClick()) {
emit activated(); emit activated();
} }
update();
} }
void IconWidget::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void IconWidget::hoverEnterEvent(QGraphicsSceneHoverEvent *event)