DlgCdg::DlgCdg(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), ui(new Ui::DlgCdg) { if (settings->cdgWindowFullScreenMonitor() > QApplication::desktop()->numScreens()) { settings->setCdgWindowFullscreen(false); } hSizeAdjustment = settings->cdgHSizeAdjustment(); vSizeAdjustment = settings->cdgVSizeAdjustment(); hOffset = settings->cdgHOffset(); vOffset = settings->cdgVOffset(); ui->setupUi(this); m_fullScreen = false; m_lastSize.setWidth(300); m_lastSize.setHeight(216); ui->scroll->setFont(settings->tickerFont()); ui->scroll->setMinimumHeight(settings->tickerHeight()); ui->scroll->setMaximumHeight(settings->tickerHeight()); ui->scroll->setSpeed(settings->tickerSpeed()); QPalette palette = ui->scroll->palette(); palette.setColor(ui->scroll->foregroundRole(), settings->tickerTextColor()); ui->scroll->setPalette(palette); palette = this->palette(); palette.setColor(QPalette::Background, settings->tickerBgColor()); this->setPalette(palette); ui->scroll->setText("This is some text to scroll - This is some text to scroll - This is some text to scroll - This is some text to scroll - This is some text to scroll - This is some text to scroll - This is some text to scroll - This is some text to scroll"); connect(settings, SIGNAL(tickerFontChanged()), this, SLOT(tickerFontChanged())); connect(settings, SIGNAL(tickerHeightChanged(int)), this, SLOT(tickerHeightChanged())); connect(settings, SIGNAL(tickerSpeedChanged()), this, SLOT(tickerSpeedChanged())); connect(settings, SIGNAL(tickerTextColorChanged()), this, SLOT(tickerTextColorChanged())); connect(settings, SIGNAL(tickerBgColorChanged()), this, SLOT(tickerBgColorChanged())); connect(settings, SIGNAL(tickerEnableChanged()), this, SLOT(tickerEnableChanged())); connect(settings, SIGNAL(cdgHOffsetChanged(int)), this, SLOT(setHOffset(int))); connect(settings, SIGNAL(cdgVOffsetChanged(int)), this, SLOT(setVOffset(int))); connect(settings, SIGNAL(cdgHSizeAdjustmentChanged(int)), this, SLOT(setHSizeAdjustment(int))); connect(settings, SIGNAL(cdgVSizeAdjustmentChanged(int)), this, SLOT(setVSizeAdjustment(int))); connect(settings, SIGNAL(cdgShowCdgWindowChanged(bool)), this, SLOT(setVisible(bool))); connect(settings, SIGNAL(cdgWindowFullscreenChanged(bool)), this, SLOT(setFullScreen(bool))); fullScreenTimer = new QTimer(this); connect(fullScreenTimer, SIGNAL(timeout()), this, SLOT(fullScreenTimerTimeout())); fullScreenTimer->setInterval(500); ui->cdgVideo->videoSurface()->start(); if ((settings->cdgWindowFullscreen()) && (settings->showCdgWindow())) { makeFullscreen(); } else if (settings->showCdgWindow()) show(); fullScreenTimer = new QTimer(this); connect(fullScreenTimer, SIGNAL(timeout()), this, SLOT(fullScreenTimerTimeout())); fullScreenTimer->setInterval(500); ui->bgImage->setVisible(false); }
void Settings::setTickerTextColor(QColor color) { settings->setValue("tickerTextColor", color); emit tickerTextColorChanged(); }