1 | #include "eventdialog.h" |
---|
2 | |
---|
3 | #include <QScrollBar> |
---|
4 | |
---|
5 | EventDialog::EventDialog(const int &aEventId, QWidget *aParent) |
---|
6 | : QDialog(aParent) |
---|
7 | , mEventId(aEventId) |
---|
8 | { |
---|
9 | setupUi(this); |
---|
10 | |
---|
11 | const int confId = 1; |
---|
12 | Event event = Event::getById(aEventId,confId); |
---|
13 | |
---|
14 | abstract->setStyleSheet("background-color : transparent;"); |
---|
15 | description->setStyleSheet("background-color : transparent;"); |
---|
16 | |
---|
17 | // use text color from 'title' QLabel |
---|
18 | QColor color = title->palette().color(QPalette::Active, QPalette::WindowText); |
---|
19 | QPalette p = abstract->palette(); |
---|
20 | //p.setColor(QPalette::Active, QPalette::Text, Qt::blue); |
---|
21 | p.setColor(QPalette::Active, QPalette::Text, color); |
---|
22 | p.setColor(QPalette::Active, QPalette::WindowText, color); |
---|
23 | abstract->setPalette(p); |
---|
24 | description->setPalette(p); |
---|
25 | |
---|
26 | // set scrollbars color |
---|
27 | QPalette p2 = description->verticalScrollBar()->palette(); |
---|
28 | p2.setColor(QPalette::Active, QPalette::Background, color); |
---|
29 | //description->verticalScrollBar()->setStyleSheet("background-color : blue;"); |
---|
30 | abstract->verticalScrollBar()->setPalette(p2); |
---|
31 | description->verticalScrollBar()->setPalette(p2); |
---|
32 | |
---|
33 | title->setText(event.title()); |
---|
34 | persons->setText(event.persons().join(" and ")); |
---|
35 | abstract->setPlainText(event.abstract()); |
---|
36 | description->setPlainText(event.description()); |
---|
37 | } |
---|
38 | |
---|