event dialog changes
[toast/confclerk.git] / src / gui / eventdialog.cpp
index dbd277d..237345f 100644 (file)
@@ -1,20 +1,38 @@
 #include "eventdialog.h"
 
 #include "eventdialog.h"
 
-#include <QDebug>
+#include <QScrollBar>
 
 
-EventDialog::EventDialog(const QModelIndex &aIndex, QWidget *aParent)
+EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
     : QDialog(aParent)
     : QDialog(aParent)
-    , mIndex(aIndex)
+    , mEventId(aEventId)
 {
     setupUi(this);
 
 {
     setupUi(this);
 
-    abstract->setStyleSheet("background-color : transparent;");
-    description->setStyleSheet("background-color : transparent;");
+    const int confId = 1;
+    Event event = Event::getById(aEventId,confId);
 
 
-    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());
+    //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, 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);
+
+    title->setText(event.title());
+    persons->setText(event.persons().join(" and "));
+    abstract->setPlainText(event.abstract());
+    description->setPlainText(event.description());
 }
 
 }