summaryrefslogtreecommitdiff
path: root/utils/themeeditor
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor')
-rw-r--r--utils/themeeditor/preferencesdialog.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/themeeditor/preferencesdialog.cpp b/utils/themeeditor/preferencesdialog.cpp
index 78f2ed7..8cd9665 100644
--- a/utils/themeeditor/preferencesdialog.cpp
+++ b/utils/themeeditor/preferencesdialog.cpp
@@ -165,7 +165,7 @@ void PreferencesDialog::setupUI()
void PreferencesDialog::colorClicked()
{
- QColor* toEdit = 0;
+ QColor* toEdit = 0, newColor;
if(QObject::sender() == ui->bgButton)
toEdit = &bgColor;
@@ -185,8 +185,12 @@ void PreferencesDialog::colorClicked()
if(!toEdit)
return;
- *toEdit = QColorDialog::getColor(*toEdit, this);
- setButtonColor(dynamic_cast<QPushButton*>(QObject::sender()), *toEdit);
+ newColor = QColorDialog::getColor(*toEdit, this);
+ if (newColor.isValid())
+ {
+ *toEdit = newColor;
+ setButtonColor(dynamic_cast<QPushButton*>(QObject::sender()), *toEdit);
+ }
}
void PreferencesDialog::accept()