summaryrefslogtreecommitdiffstats
path: root/qt-ui/templateedit.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-08-07 09:54:09 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-08-15 15:02:30 +0300
commit1dbe10fe278650430beca638976ea7df3b5c76fd (patch)
tree012d141cf23cc0c410a2894ce040c0402e2e1d8b /qt-ui/templateedit.cpp
parent1a2f154cf49041a223e5801328beb68cb8b42442 (diff)
downloadsubsurface-1dbe10fe278650430beca638976ea7df3b5c76fd.tar.gz
Printing: add another color in color palettes
Add another color 'Table cells 2' to the color palette, make all the backgrounds solid white by default. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Diffstat (limited to 'qt-ui/templateedit.cpp')
-rw-r--r--qt-ui/templateedit.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp
index 90ef7e750..e4e6453ac 100644
--- a/qt-ui/templateedit.cpp
+++ b/qt-ui/templateedit.cpp
@@ -30,6 +30,7 @@ TemplateEdit::TemplateEdit(QWidget *parent, struct print_options *printOptions,
btnGroup->addButton(ui->editButton3, 3);
btnGroup->addButton(ui->editButton4, 4);
btnGroup->addButton(ui->editButton5, 5);
+ btnGroup->addButton(ui->editButton6, 6);
connect(btnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(colorSelect(QAbstractButton*)));
ui->plainTextEdit->setPlainText(grantlee_template);
@@ -60,12 +61,14 @@ void TemplateEdit::updatePreview()
ui->colorLable3->setStyleSheet("QLabel { background-color : \"" + newTemplateOptions.color_palette.color3.name() + "\";}");
ui->colorLable4->setStyleSheet("QLabel { background-color : \"" + newTemplateOptions.color_palette.color4.name() + "\";}");
ui->colorLable5->setStyleSheet("QLabel { background-color : \"" + newTemplateOptions.color_palette.color5.name() + "\";}");
+ ui->colorLable6->setStyleSheet("QLabel { background-color : \"" + newTemplateOptions.color_palette.color6.name() + "\";}");
ui->colorLable1->setText(newTemplateOptions.color_palette.color1.name());
ui->colorLable2->setText(newTemplateOptions.color_palette.color2.name());
ui->colorLable3->setText(newTemplateOptions.color_palette.color3.name());
ui->colorLable4->setText(newTemplateOptions.color_palette.color4.name());
ui->colorLable5->setText(newTemplateOptions.color_palette.color5.name());
+ ui->colorLable6->setText(newTemplateOptions.color_palette.color6.name());
// update critical UI elements
ui->colorpalette->setCurrentIndex(newTemplateOptions.color_palette_index);
@@ -197,6 +200,11 @@ void TemplateEdit::colorSelect(QAbstractButton *button)
if (color.isValid()) {
newTemplateOptions.color_palette.color5 = color;
} break;
+ case 6:
+ color = QColorDialog::getColor(newTemplateOptions.color_palette.color6, this);
+ if (color.isValid()) {
+ newTemplateOptions.color_palette.color6 = color;
+ } break;
}
newTemplateOptions.color_palette_index = CUSTOM;
updatePreview();