diff options
author | deva <deva> | 2009-07-03 11:59:24 +0000 |
---|---|---|
committer | deva <deva> | 2009-07-03 11:59:24 +0000 |
commit | 82c32c05eb4741e98736099c456b3ffc93c755af (patch) | |
tree | 4d68d0a1d79e3f1821a541c3f50060c80d89953f /client/macrodrawer.cc | |
parent | cca848759185ced5826194a7bbf4932881aee224 (diff) |
Some tweaking in the new dependency system. Mostly GUI stuff.
Diffstat (limited to 'client/macrodrawer.cc')
-rw-r--r-- | client/macrodrawer.cc | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/client/macrodrawer.cc b/client/macrodrawer.cc index f3fcab1..47edc22 100644 --- a/client/macrodrawer.cc +++ b/client/macrodrawer.cc @@ -27,31 +27,37 @@ #include "macrodrawer.h" #include <QPushButton> +#include <QApplication> +#include <QSvgRenderer> +#include <QPainter> +#include <QImage> -MacroDrawer::MacroDrawer(Macro *macro, QString title) +MacroDrawer::MacroDrawer(Macro *macro, QString title, QWidget *edge) { + button = NULL; + this->edge = edge; + if(!macro->isstatic) setTitle(" " + title); setFlat(true); { - QFont f = font(); - f.setItalic(true); + QFont f = font(); f.setItalic(true); setFont(f); } if(!macro->isstatic) { - QPushButton *b = new QPushButton("±", this); - b->setFixedSize(16,16); - b->move(0,0); + button = new QPushButton(this); + button->setFixedSize(16,16); + button->move(0,0); { - QFont f = b->font(); + QFont f = button->font(); f.setBold(false); f.setItalic(false); - b->setFont(f); + button->setFont(f); } installEventFilter(this); - connect(b, SIGNAL(clicked()), this, SLOT(toggleMe())); + connect(button, SIGNAL(clicked()), this, SLOT(toggleMe())); } } @@ -73,4 +79,29 @@ void MacroDrawer::activationChange(bool active) { //printf("Active %d\n", (int)active); setEnabled(active); + /* + if(active) { + QPalette palette = edge->palette(); + palette.setBrush(QPalette::Window, QBrush(QColor(150, 150, 255))); + edge->setPalette(palette); + } else { + edge->setPalette(QApplication::palette()); + } + */ + + if(!active) { + // Set padlock icon on button. + if(button) { + button->setIcon(QPixmap(":icons/padlock.png")); + button->setText(""); + } + + } else { + // Clear padlock icon on button + if(button) { + button->setIcon(QPixmap()); + button->setText("±"); + } + } + } |