make clicking on the border of the toolbar activate toolbar buttons

This commit is contained in:
Mark Tiefenbruck 2008-08-23 17:14:31 -07:00
parent 36d1edfbf6
commit 65c5fb3237

View file

@ -128,9 +128,10 @@ void Button::buttonReleaseEvent(XButtonEvent &event) {
// hence the mark_if_deleted mechanism so that we can
// update our state after the command
if (event.button > 0 && event.button <= 5 &&
// I'm not quite sure why we get events with e.g. y == height, but we do
event.x >= 0 && event.x <= static_cast<signed>(width()) &&
event.y >= 0 && event.y <= static_cast<signed>(height()) &&
event.x >= -static_cast<signed>(borderWidth()) &&
event.x <= static_cast<signed>(width()+borderWidth()) &&
event.y >= -static_cast<signed>(borderWidth()) &&
event.y <= static_cast<signed>(height()+borderWidth()) &&
m_onclick[event.button -1].get() != 0)
m_onclick[event.button - 1]->execute();