Corregido el aspecto de elegir color de fondo y la actualizaci?n autom?tica al

cerrar el di?logo de opciones
This commit is contained in:
Luis Ángel San Martín 2013-01-20 17:25:46 +01:00
parent ae4913b685
commit daa4b77c15
2 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,8 @@ OptionsDialog::OptionsDialog(QWidget * parent)
//backgroundColor->setMinimumWidth(100); //backgroundColor->setMinimumWidth(100);
colorSelection->addWidget(backgroundColor); colorSelection->addWidget(backgroundColor);
colorSelection->addWidget(selectBackgroundColorButton = new QPushButton(tr("Choose"))); colorSelection->addWidget(selectBackgroundColorButton = new QPushButton(tr("Choose")));
colorSelection->setStretchFactor(backgroundColor,1);
colorSelection->setStretchFactor(selectBackgroundColorButton,0);
//colorSelection->addStretch(); //colorSelection->addStretch();
connect(selectBackgroundColorButton, SIGNAL(clicked()), colorDialog, SLOT(show())); connect(selectBackgroundColorButton, SIGNAL(clicked()), colorDialog, SLOT(show()));
colorBox->setLayout(colorSelection); colorBox->setLayout(colorSelection);
@ -173,6 +175,10 @@ void OptionsDialog::updateColor(const QColor & color)
backgroundColor->setPalette(pal); backgroundColor->setPalette(pal);
backgroundColor->setAutoFillBackground(true); backgroundColor->setAutoFillBackground(true);
colorDialog->setCurrentColor(color); colorDialog->setCurrentColor(color);
settings->setValue(BACKGROUND_COLOR,color);
emit(changedOptions());
} }
void OptionsDialog::fitToWidthRatio(int value) void OptionsDialog::fitToWidthRatio(int value)

View File

@ -731,6 +731,10 @@ void Viewer::updateFitToWidthRatio(float ratio)
void Viewer::updateConfig(QSettings * settings) void Viewer::updateConfig(QSettings * settings)
{ {
goToFlow->updateConfig(settings); goToFlow->updateConfig(settings);
QPalette palette;
palette.setColor(backgroundRole(), Configuration::getConfiguration().getBackgroundColor());
setPalette(palette);
} }
void Viewer::setBookmarks() void Viewer::setBookmarks()