* emit pressed(true) when pressed
* excuse the debuggin, but i need to figure out why events are getting eaten (again) by the icon class svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=728763
This commit is contained in:
parent
db095df33e
commit
97ddf36df4
@ -915,18 +915,21 @@ bool Icon::isDown()
|
|||||||
|
|
||||||
void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
kDebug();
|
||||||
foreach (IconAction *action, d->cornerActions) {
|
foreach (IconAction *action, d->cornerActions) {
|
||||||
action->event(event->type(), event->pos());
|
action->event(event->type(), event->pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
d->state = Private::PressedState;
|
d->state = Private::PressedState;
|
||||||
|
emit pressed(true);
|
||||||
|
|
||||||
QGraphicsItem::mousePressEvent(event);
|
event->ignore();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
kDebug();
|
||||||
bool inside = boundingRect().contains(event->pos());
|
bool inside = boundingRect().contains(event->pos());
|
||||||
Private::ButtonState was = d->state;
|
Private::ButtonState was = d->state;
|
||||||
|
|
||||||
@ -952,7 +955,7 @@ void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
d->state = Private::NoState;
|
d->state = Private::NoState;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsItem::mouseReleaseEvent(event);
|
event->ignore();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -964,7 +967,7 @@ void Icon::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->state = Private::HoverState;
|
d->state = Private::HoverState;
|
||||||
QGraphicsItem::hoverEnterEvent(event);
|
Widget::hoverEnterEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
@ -975,7 +978,7 @@ void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->state = Private::NoState;
|
d->state = Private::NoState;
|
||||||
QGraphicsItem::hoverLeaveEvent(event);
|
Widget::hoverLeaveEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
@ -984,7 +987,7 @@ void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
d->state = Private::HoverState;
|
d->state = Private::HoverState;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsItem::mouseMoveEvent(event);
|
Widget::mouseMoveEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSizeF Icon::sizeHint() const
|
QSizeF Icon::sizeHint() const
|
||||||
|
Loading…
Reference in New Issue
Block a user