forked from len0rd/rockbox
Theme editor: only accept valid colors in the preference dialog
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26857 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a316ebe65b
commit
98a5780d6d
1 changed files with 7 additions and 3 deletions
|
@ -165,7 +165,7 @@ void PreferencesDialog::setupUI()
|
||||||
|
|
||||||
void PreferencesDialog::colorClicked()
|
void PreferencesDialog::colorClicked()
|
||||||
{
|
{
|
||||||
QColor* toEdit = 0;
|
QColor* toEdit = 0, newColor;
|
||||||
|
|
||||||
if(QObject::sender() == ui->bgButton)
|
if(QObject::sender() == ui->bgButton)
|
||||||
toEdit = &bgColor;
|
toEdit = &bgColor;
|
||||||
|
@ -185,9 +185,13 @@ void PreferencesDialog::colorClicked()
|
||||||
if(!toEdit)
|
if(!toEdit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
*toEdit = QColorDialog::getColor(*toEdit, this);
|
newColor = QColorDialog::getColor(*toEdit, this);
|
||||||
|
if (newColor.isValid())
|
||||||
|
{
|
||||||
|
*toEdit = newColor;
|
||||||
setButtonColor(dynamic_cast<QPushButton*>(QObject::sender()), *toEdit);
|
setButtonColor(dynamic_cast<QPushButton*>(QObject::sender()), *toEdit);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PreferencesDialog::accept()
|
void PreferencesDialog::accept()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue