From daa4b77c15fc19af7a95f89b56c257390fd0108c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sun, 20 Jan 2013 17:25:46 +0100 Subject: [PATCH] Corregido el aspecto de elegir color de fondo y la actualizaci?n autom?tica al cerrar el di?logo de opciones --- YACReader/options_dialog.cpp | 6 ++++++ YACReader/viewer.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/YACReader/options_dialog.cpp b/YACReader/options_dialog.cpp index 0eb12d62..612ce881 100644 --- a/YACReader/options_dialog.cpp +++ b/YACReader/options_dialog.cpp @@ -67,6 +67,8 @@ OptionsDialog::OptionsDialog(QWidget * parent) //backgroundColor->setMinimumWidth(100); colorSelection->addWidget(backgroundColor); colorSelection->addWidget(selectBackgroundColorButton = new QPushButton(tr("Choose"))); + colorSelection->setStretchFactor(backgroundColor,1); + colorSelection->setStretchFactor(selectBackgroundColorButton,0); //colorSelection->addStretch(); connect(selectBackgroundColorButton, SIGNAL(clicked()), colorDialog, SLOT(show())); colorBox->setLayout(colorSelection); @@ -173,6 +175,10 @@ void OptionsDialog::updateColor(const QColor & color) backgroundColor->setPalette(pal); backgroundColor->setAutoFillBackground(true); colorDialog->setCurrentColor(color); + + settings->setValue(BACKGROUND_COLOR,color); + + emit(changedOptions()); } void OptionsDialog::fitToWidthRatio(int value) diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index f30983ab..ee28cf0d 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -731,6 +731,10 @@ void Viewer::updateFitToWidthRatio(float ratio) void Viewer::updateConfig(QSettings * settings) { goToFlow->updateConfig(settings); + + QPalette palette; + palette.setColor(backgroundRole(), Configuration::getConfiguration().getBackgroundColor()); + setPalette(palette); } void Viewer::setBookmarks()