From 3a6fc641e1f3d72be5e0036987a106b8c9c0db00 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 19 Feb 2010 13:11:18 +0000 Subject: Make macros expand/collapse only when the button or the title are clicked. Not the line. --- client/macrodrawer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/macrodrawer.cc b/client/macrodrawer.cc index 47edc22..89bd255 100644 --- a/client/macrodrawer.cc +++ b/client/macrodrawer.cc @@ -65,7 +65,10 @@ bool MacroDrawer::eventFilter(QObject *obj, QEvent *event) { if(event->type() == QEvent::MouseButtonRelease) { QMouseEvent *mouseEvent = static_cast(event); - if(mouseEvent->y() < 16 && isEnabled()) emit toggle(); + if(mouseEvent->y() < 16 && isEnabled() && + // Temporay hack. TODO: Calculate actual text width. + mouseEvent->x() < title().length() * 5) + emit toggle(); } return QObject::eventFilter(obj, event); } -- cgit v1.2.3