From 67bfa9f96819ae3e2da07ff1413b90990fab745d Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Sat, 15 Aug 2015 22:51:29 +0200 Subject: Printing: use older Qt methods when calculating the ceil Better portability for < Qt5.3. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Gehad elrobey --- printer.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/printer.cpp b/printer.cpp index b0caa0815..d0a165dcb 100644 --- a/printer.cpp +++ b/printer.cpp @@ -194,13 +194,8 @@ void Printer::print() connect(&t, SIGNAL(progressUpdated(int)), this, SLOT(templateProgessUpdated(int))); dpi = printerPtr->resolution(); //rendering resolution = selected paper size in inchs * printer dpi -#if QT_VERSION >= 0x050300 - pageSize.setHeight(printerPtr->pageLayout().paintRectPixels(dpi).height()); - pageSize.setWidth(printerPtr->pageLayout().paintRectPixels(dpi).width()); -#else - pageSize.setHeight(printerPtr->pageRect(QPrinter::Inch).height() * dpi); - pageSize.setWidth(printerPtr->pageRect(QPrinter::Inch).width() * dpi); -#endif + pageSize.setHeight(std::ceil(printerPtr->pageRect(QPrinter::Inch).height() * dpi)); + pageSize.setWidth(std::ceil(printerPtr->pageRect(QPrinter::Inch).width() * dpi)); webView->page()->setViewportSize(pageSize); webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); // export border width with at least 1 pixel -- cgit v1.2.3-70-g09d2 From b19d07c61cc985eeaccf6cbf8b87db2e1dcfa774 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Sun, 16 Aug 2015 15:45:15 +0200 Subject: Printing: fix the six dives per page layout Add container with height 100% which contains the six dives, so dives don't overflow the page. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Gehad elrobey --- printing_templates/Six Dives.html | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/printing_templates/Six Dives.html b/printing_templates/Six Dives.html index 3f2c7b95e..9d4d1341e 100644 --- a/printing_templates/Six Dives.html +++ b/printing_templates/Six Dives.html @@ -40,11 +40,11 @@ .mainContainer { width: 50%; - height: 33.333333%; + height: 33.333%; margin-left: 0%; margin-right: 0%; - margin-top: 0; - margin-bottom: 0; + margin-top: 0%; + margin-bottom: 0%; overflow: hidden; page-break-inside: avoid; float: left; @@ -111,12 +111,20 @@ text-overflow: ellipsis; line-height: {{ template_options.line_spacing }}; } + + #sixdivespack { + width: 100%; + height: 100%; + }
{% block main_rows %} {% for dive in dives %} + {% if forloop.counter|divisibleby:6 %} +
+ {% endif %}
@@ -173,6 +181,9 @@
+ {% if forloop.counter|divisibleby:6 %} +
+ {% endif %} {% endfor %} {% endblock %}