diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2015-07-12 05:00:03 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2015-07-20 15:28:20 +0300 |
commit | ad531c25fbf4094f2cbfd54018fe74d710b547f1 (patch) | |
tree | a44f688d1a8e14891fea59595639d400e6c7499e /qt-ui/templateedit.cpp | |
parent | dcedc8ebea5a686f87d51daefa83728696d26b1a (diff) | |
download | subsurface-ad531c25fbf4094f2cbfd54018fe74d710b547f1.tar.gz |
Printing: show colors in edit tab
- Add default color struct
- Init the color struct with default colors
- Show color text in labels
- Preview colors
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui/templateedit.cpp')
-rw-r--r-- | qt-ui/templateedit.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp index 8d216d998..bb545392a 100644 --- a/qt-ui/templateedit.cpp +++ b/qt-ui/templateedit.cpp @@ -39,6 +39,7 @@ TemplateEdit::~TemplateEdit() void TemplateEdit::updatePreview() { + // update Qpixmap preview int width = ui->label->width(); int height = ui->label->height(); QPixmap map(width * 2, height * 2); @@ -46,6 +47,19 @@ void TemplateEdit::updatePreview() Printer printer(&map, printOptions, &newTemplateOptions, Printer::PREVIEW); printer.previewOnePage(); ui->label->setPixmap(map.scaled(width, height, Qt::IgnoreAspectRatio)); + + // update colors tab + ui->colorLable1->setStyleSheet("QLabel { background-color : \"" + newTemplateOptions.color_palette.color1.name() + "\";}"); + ui->colorLable2->setStyleSheet("QLabel { background-color : \"" + newTemplateOptions.color_palette.color2.name() + "\";}"); + 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->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()); } void TemplateEdit::on_fontsize_valueChanged(int font_size) |