Ignore:
Timestamp:
01/25/10 12:07:00 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
7b70507
Parents:
6dc0dbc
Message:

GUI work on Event Details dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/eventdialog.cpp

    r6dc0dbc r183eecd  
    33
    44#include <QScrollBar>
     5
     6DetailsContainer::DetailsContainer(QWidget *aParent)
     7    : QWidget(aParent)
     8{
     9    mAbstract.setWordWrap(true);
     10    mDescription.setWordWrap(true);
     11
     12    QFont f = QLabel().font();
     13    f.setBold(true);
     14    f.setItalic(true);
     15    mMainLayout = new QVBoxLayout(this);
     16    QLabel *persons = new QLabel("Persons:");
     17    persons->setFont(f);
     18    mMainLayout->addWidget(persons);
     19    mMainLayout->addWidget(&mPersons);
     20    mMainLayout->addWidget(new QLabel("")); // spacer
     21    QLabel *abstract = new QLabel("Abstract:");
     22    abstract->setFont(f);
     23    mMainLayout->addWidget(abstract);
     24    mMainLayout->addWidget(&mAbstract);
     25    mMainLayout->addWidget(new QLabel("")); // spacer
     26    QLabel *description = new QLabel("Description:");
     27    description->setFont(f);
     28    mMainLayout->addWidget(description);
     29    mMainLayout->addWidget(&mDescription);
     30    setLayout(mMainLayout);
     31}
     32
     33void DetailsContainer::setPersons(const QStringList &aPersons)
     34{
     35    mPersons.setText(aPersons.join(" and "));
     36}
     37
     38void DetailsContainer::setAbstract(const QString &aAbstract)
     39{
     40    mAbstract.setText(aAbstract);
     41}
     42
     43void DetailsContainer::setDescription(const QString &aDescription)
     44{
     45    mDescription.setText(aDescription);
     46}
    547
    648EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
     
    1658    Event event = Event::getById(aEventId,AppSettings::confId());
    1759
    18     //abstract->setStyleSheet("background-color : transparent;");
    19     //description->setStyleSheet("background-color : transparent;");
    20 
    21     // use text color from 'title' QLabel
    22     QColor color = title->palette().color(QPalette::Active, QPalette::WindowText);
    23     QColor bkgrColor = this->palette().color(QPalette::Active, QPalette::Background);
    24     QPalette p = abstract->palette();
    25     p.setColor(QPalette::Active, QPalette::Text, color);
    26     p.setColor(QPalette::Active, QPalette::Base, bkgrColor);
    27     abstract->setPalette(p);
    28     description->setPalette(p);
    29 
    30     // set scrollbars color
    31     //QPalette p2 = description->verticalScrollBar()->palette();
    32     //p2.setColor(QPalette::Active, QPalette::Background, color);
    33     ////description->verticalScrollBar()->setStyleSheet("background-color : blue;");
    34     //abstract->verticalScrollBar()->setPalette(p2);
    35     //description->verticalScrollBar()->setPalette(p2);
    36 
    3760    title->setText(event.title());
    38     persons->setText(event.persons().join(" and "));
    39     abstract->setPlainText(event.abstract());
    40     description->setPlainText(event.description());
     61    mDetails.setPersons(event.persons());
     62    mDetails.setAbstract(event.abstract());
     63    mDetails.setDescription(event.description());
     64    scrollArea->setWidget(&mDetails);
    4165}
    4266
Note: See TracChangeset for help on using the changeset viewer.