From ef03bf6e719f256554878c8efe19f4856a39dd03 Mon Sep 17 00:00:00 2001 From: Alex Borisov Date: Sun, 13 Nov 2011 05:33:34 +0200 Subject: CSS style support and sample. Revert to file config for testing purposes --- client/Dialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'client/Dialog.cpp') diff --git a/client/Dialog.cpp b/client/Dialog.cpp index e9d3883..bf0c530 100644 --- a/client/Dialog.cpp +++ b/client/Dialog.cpp @@ -12,9 +12,11 @@ using namespace std; ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent) { UpdatedConfig *cfg = UpdatedConfig::CurrentConfig(); + cfg->AcquireConfig(); /* generic proxy panel */ topLabel = new QLabel(QString::fromLocal8Bit(cfg->TopPanelText.c_str())); + topLabel->setObjectName("topLabel"); topLabel->setAlignment(Qt::AlignHCenter); countryBox = new QComboBox; stateBox = new QComboBox; @@ -45,6 +47,7 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent) /* static proxy panel */ bottomLabel = new QLabel(QString::fromLocal8Bit(cfg->BottomPanelText.c_str())); + bottomLabel->setObjectName("bottomLabel"); bottomLabel->setAlignment(Qt::AlignHCenter); QGridLayout *bottomPanelLayout = new QGridLayout; unsigned nlines = cfg->GetStaticProxyGuiLines(); @@ -74,6 +77,7 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent) btnLayout->addWidget(btnLabel); btnLayout->setSizeConstraint(QLayout::SetMinimumSize); QPushButton *btn = new QPushButton(); + btn->setObjectName("bottomBtn"); btn->setLayout(btnLayout); btn->setCheckable(true); bottomPanelLayout->addWidget(btn, i, j); @@ -87,6 +91,14 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent) mainLayout->addWidget(bottomLabel); mainLayout->addLayout(bottomPanelLayout); setLayout(mainLayout); + + QFile file("style.qss"); + file.open(QFile::ReadOnly); + QString cssStr = QString::fromLocal8Bit(file.readAll()); + file.close(); + + Logger::Debug("Going to apply css style: %s\n", cssStr.toLocal8Bit().data()); + setStyleSheet(cssStr); } void ProxyDialog::CountryActivated(int index) -- cgit v1.2.3