summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/templateedit.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp
index 94ed276b5..95e7ebac7 100644
--- a/qt-ui/templateedit.cpp
+++ b/qt-ui/templateedit.cpp
@@ -168,24 +168,30 @@ void TemplateEdit::colorSelect(QAbstractButton *button)
switch (btnGroup->id(button)) {
case 1:
color = QColorDialog::getColor(newTemplateOptions.color_palette.color1, this);
- newTemplateOptions.color_palette.color1 = color;
+ if (color.isValid()) {
+ newTemplateOptions.color_palette.color1 = color;
+ }
break;
case 2:
color = QColorDialog::getColor(newTemplateOptions.color_palette.color2, this);
- newTemplateOptions.color_palette.color2 = color;
- break;
+ if (color.isValid()) {
+ newTemplateOptions.color_palette.color2 = color;
+ } break;
case 3:
color = QColorDialog::getColor(newTemplateOptions.color_palette.color3, this);
- newTemplateOptions.color_palette.color3 = color;
- break;
+ if (color.isValid()) {
+ newTemplateOptions.color_palette.color3 = color;
+ } break;
case 4:
color = QColorDialog::getColor(newTemplateOptions.color_palette.color4, this);
- newTemplateOptions.color_palette.color4 = color;
- break;
+ if (color.isValid()) {
+ newTemplateOptions.color_palette.color4 = color;
+ } break;
case 5:
color = QColorDialog::getColor(newTemplateOptions.color_palette.color5, this);
- newTemplateOptions.color_palette.color5 = color;
- break;
+ if (color.isValid()) {
+ newTemplateOptions.color_palette.color5 = color;
+ } break;
}
newTemplateOptions.color_palette_index = CUSTOM;
updatePreview();