diff options
Diffstat (limited to 'client/macrodrawer.cc')
-rw-r--r-- | client/macrodrawer.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/client/macrodrawer.cc b/client/macrodrawer.cc index 85cab3f..f3fcab1 100644 --- a/client/macrodrawer.cc +++ b/client/macrodrawer.cc @@ -28,11 +28,9 @@ #include <QPushButton> -MacroDrawer::MacroDrawer(MacroWindow *p, QString title) +MacroDrawer::MacroDrawer(Macro *macro, QString title) { - mw = p; - - if(!mw->isstatic) setTitle(" " + title); + if(!macro->isstatic) setTitle(" " + title); setFlat(true); { @@ -41,7 +39,7 @@ MacroDrawer::MacroDrawer(MacroWindow *p, QString title) setFont(f); } - if(!mw->isstatic) { + if(!macro->isstatic) { QPushButton *b = new QPushButton("±", this); b->setFixedSize(16,16); b->move(0,0); @@ -61,7 +59,7 @@ bool MacroDrawer::eventFilter(QObject *obj, QEvent *event) { if(event->type() == QEvent::MouseButtonRelease) { QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); - if(mouseEvent->y() < 16 && isEnabled()) toggle(); + if(mouseEvent->y() < 16 && isEnabled()) emit toggle(); } return QObject::eventFilter(obj, event); } @@ -70,3 +68,9 @@ void MacroDrawer::toggleMe() { emit toggle(); } + +void MacroDrawer::activationChange(bool active) +{ + //printf("Active %d\n", (int)active); + setEnabled(active); +} |