summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2011-06-28 06:33:02 +0000
committerdeva <deva>2011-06-28 06:33:02 +0000
commita4b5fd34f5c3d98a438ae3519cd404c2aeeaf330 (patch)
tree714992d8217e0c2a5321734aaf4331e9dc525678
parent540221455626e4d48fee76d8c6cb86e5d2607f4e (diff)
Hnadle 'important' attribute on macros.
-rw-r--r--client/macro.cc2
-rw-r--r--client/macro.h2
-rw-r--r--client/macrodrawer.cc19
3 files changed, 19 insertions, 4 deletions
diff --git a/client/macro.cc b/client/macro.cc
index d6be5cc..dfe464d 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -45,6 +45,7 @@ Macro::Macro(Entities &e, NetCom &n, QString t, QScrollArea *s)
isstatic = false;
iscompact = false;
+ isimportant = false;
}
const char *Macro::type()
@@ -62,6 +63,7 @@ void Macro::update(QDomNode &node)
iscompleted = elem.attribute("completed", "false") == "true";
isstatic = elem.attribute("static", "false") == "true";
iscompact = elem.attribute("compact", "false") == "true";
+ isimportant = elem.attribute("important", "false") == "true";
if(drawer == NULL) {
drawer = new MacroDrawer(this, elem.attribute("caption", name));
diff --git a/client/macro.h b/client/macro.h
index e5b116c..b24b809 100644
--- a/client/macro.h
+++ b/client/macro.h
@@ -46,6 +46,7 @@ class Macro : public Entity {
public:
Macro(Entities &entities, NetCom &netcom, QString templ,
QScrollArea *scrollarea);
+ virtual ~Macro() {}
const char *type();
@@ -67,6 +68,7 @@ public:
bool isstatic;
bool iscompact;
+ bool isimportant;
MacroWindow *window;
MacroDrawer *drawer;
diff --git a/client/macrodrawer.cc b/client/macrodrawer.cc
index 8c713b0..570ce54 100644
--- a/client/macrodrawer.cc
+++ b/client/macrodrawer.cc
@@ -45,7 +45,17 @@ MacroDrawer::MacroDrawer(Macro *macro, QString title)
setFlat(true);
{
- QFont f = font(); f.setItalic(true);
+ QFont f = font();
+ f.setItalic(true);
+ if(macro->isimportant) {
+ f.setBold(true);
+ // f.setPointSize(f.pointSize() * 1.2);
+ /*
+ QPalette palette;
+ palette.setBrush(QPalette::Foreground, QBrush(QColor(157, 30, 141)));
+ setPalette(palette);
+ */
+ }
setFont(f);
}
@@ -64,9 +74,10 @@ MacroDrawer::MacroDrawer(Macro *macro, QString title)
connect(button, SIGNAL(clicked()), this, SLOT(toggleMe()));
}
- QMargins m = contentsMargins();
- m.setLeft(6);
- setContentsMargins(m);
+ int l,t,r,b;
+ getContentsMargins(&l,&t,&r,&b);
+ l = 6;
+ setContentsMargins(l, t, r, b);
}
bool MacroDrawer::eventFilter(QObject *obj, QEvent *event)