Printing: support the "Border width" setting for templates

Going to "Template -> Edit" now has a field to enter the
border width (in pixels as only that makes sense in CSS as a flexible
unit, TMK).

This field modifies the template_options.borderwidth Grantlee
property which is part of the bundled templates already
and allows the users to modify the borders of tables.

The C++ implementation was missing, while the HTML (template)
implementation was already in place. Overlooked during GSoC.

Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2017-03-06 18:41:54 +02:00 committed by Dirk Hohndel
parent 831fe3d7f9
commit e8c918622f
6 changed files with 44 additions and 2 deletions

View file

@ -20,6 +20,7 @@ TemplateEdit::TemplateEdit(QWidget *parent, struct print_options *printOptions,
ui->fontsize->setValue(templateOptions->font_size);
ui->colorpalette->setCurrentIndex(templateOptions->color_palette_index);
ui->linespacing->setValue(templateOptions->line_spacing);
ui->borderwidth->setValue(templateOptions->border_width);
grantlee_template = TemplateLayout::readTemplate(printOptions->p_template);
if (printOptions->type == print_options::DIVELIST)
@ -97,6 +98,12 @@ void TemplateEdit::on_linespacing_valueChanged(double line_spacing)
updatePreview();
}
void TemplateEdit::on_borderwidth_valueChanged(double border_width)
{
newTemplateOptions.border_width = (int)border_width;
updatePreview();
}
void TemplateEdit::on_fontSelection_currentIndexChanged(int index)
{
newTemplateOptions.font_index = index;