event dialog changes
[toast/confclerk.git] / src / gui / eventdialog.cpp
index a997dbf..237345f 100644 (file)
@@ -2,35 +2,37 @@
 
 #include <QScrollBar>
 
-EventDialog::EventDialog(const QModelIndex &aIndex, QWidget *aParent)
+EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
     : QDialog(aParent)
-    , mIndex(aIndex)
+    , mEventId(aEventId)
 {
     setupUi(this);
 
-    abstract->setStyleSheet("background-color : transparent;");
-    description->setStyleSheet("background-color : transparent;");
+    const int confId = 1;
+    Event event = Event::getById(aEventId,confId);
+
+    //abstract->setStyleSheet("background-color : transparent;");
+    //description->setStyleSheet("background-color : transparent;");
 
     // use text color from 'title' QLabel
     QColor color = title->palette().color(QPalette::Active, QPalette::WindowText);
+    QColor bkgrColor = this->palette().color(QPalette::Active, QPalette::Background);
     QPalette p = abstract->palette();
-    //p.setColor(QPalette::Active, QPalette::Text, Qt::blue);
     p.setColor(QPalette::Active, QPalette::Text, color);
-    p.setColor(QPalette::Active, QPalette::WindowText, color);
+    p.setColor(QPalette::Active, QPalette::Base, bkgrColor);
     abstract->setPalette(p);
     description->setPalette(p);
 
     // set scrollbars color
-    QPalette p2 = description->verticalScrollBar()->palette();
-    p2.setColor(QPalette::Active, QPalette::Background, color);
-    //description->verticalScrollBar()->setStyleSheet("background-color : blue;");
-    abstract->verticalScrollBar()->setPalette(p2);
-    description->verticalScrollBar()->setPalette(p2);
-
-    Event *event = static_cast<Event *>(mIndex.internalPointer());
-    title->setText(event->title());
-    persons->setText(event->persons().join(" and "));
-    abstract->setPlainText(event->abstract());
-    description->setPlainText(event->description());
+    //QPalette p2 = description->verticalScrollBar()->palette();
+    //p2.setColor(QPalette::Active, QPalette::Background, color);
+    ////description->verticalScrollBar()->setStyleSheet("background-color : blue;");
+    //abstract->verticalScrollBar()->setPalette(p2);
+    //description->verticalScrollBar()->setPalette(p2);
+
+    title->setText(event.title());
+    persons->setText(event.persons().join(" and "));
+    abstract->setPlainText(event.abstract());
+    description->setPlainText(event.description());
 }