Prevent breaking the dives in flowlayout, and the rows
in the table template. They should have the 'dontbreak'
css selector.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
While rendering a template with "0" dives per page value, try to fit
as many dives per page but don't break a dive into 2 pages.
Use a dynamically sized view port to fit the rendered area only,
and don't render the full page.
All the Template elements that shouldn't be broken should have
the CSS class "dontbreak".
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Disable all the UI elements for "dive list print", disable
all the template settings as well, Template Edit button
will be enabled after statistics print supports color palettes.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Find the border-width dynamically from the Grantlee backend.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
As there is a problem with sizing the borders in QWebView, "vw" sizing is not
working as supposed with border-width, As a workaround we export border-width
dynamically, so that border-width is relatively the same for all page sizes.
The border-width is equal to the page width / 1000 which gives a nice range
for borders for A0 - A5 papers, Also prevent drawing zero pixel borders
and use 1 px borders as the minimum border.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
This bug occurs in "table" and "flowlayout" templates, it takes place when
the size of the full web view to be rendered is not divisible by the size
of the view port (Page size), This issue is fixed by adding extra padding
to the bottom of the body so that the total body height is divisable
by the view port size.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
The are some rounding errors in the 6 dives template.
Solve them them by adding the color to the main body div.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
add more padding on the top of the profile so that the
left-right-top padding around the profile is the same.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Don't leave fields empty, this may corrupt the layout, a better way is
to insert placeholders for empty data, which also provides a better UX.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Remove extra margins and paddings in templates.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
The vertical scrollbar was causing a default margin at the right most of
the page which corrupted the page layout calculations. By hidding the
vertical scrollbar the issue is fixed.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
The actual data needs to be regular font not a bold font, so use <p>
instead of <h1> tag for the actual data fields.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Make dark colors for headers while lighter colors for data fields, this
is more intuitive, and makes the palettes more appealing.
Make dark color default for cells2
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
After adding the additional 'Table Cells 2' color to the color palette
fix the colors assigned to each field.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
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>
Add SAC, tags, used gas and dive rating to dive data fields exported
with Grantlee backend.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
While calculating the page size use QPrinter::pageRect instead of
QPrinter::pageLayout which is added in QT 5.3 and is not supported in
earlier versions.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Six dives per page templates makes good use of the page area, it can be
mainly used to produce a lightweight print outs.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Make better use of extra spaces, and decrease the margin sizes.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
While printing only draw headings, SP changes, gas events or bookmark
events, otherwise don't show anything.
Many warning logos can hide the useful information especially in
templates with small dive profile area.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Use the colors defined in the color palettes for all font, borders,
table sections and backgrounds of all templates.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
When choosing a color from the QColorDialog, the TemplateEdit trigger to
change the current selected template to be custom, and then changes the
selected color. When the selected template is changed old template
values are copied to the current template which results in incorrect
behaviour.
This is fixed by checking for the current editting state before setting
the saved palettes as the current used palette.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
The custom palette index is defined by the CUSTOM directive, and it
should be used.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
When QColorDialog is closed with 'Cancel' button, it returns invalid color
that must be discarded. So check if color is valid to prevent replacing
the current color with black.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
The default stack size on Windows per thread is 1024kb.
Using the heap prevents a stack overflow in add_plan_to_notes().
The alternative is to tell the linker to use N bytes of stack:
-Wl,--stack,N
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we are trying to open an empty file, skip the attempts to parse the
input and report an appropriate error message.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When switching from one DC to the next, the text of DC name is not updated due
to commit 487ddce353. This patch re-inserts the
call to updateText() for the specific function to get the DC name updated
properly.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Let's do the bit shift properly and not by block size.
Fixes#906
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes a bug where we would not do any gas changes at all if at the end of
bottom time we were deeper than the MOD of the bottom mix. Instead we would
constantly try to switch to that gas and find we are already breathing it.
A test case would be a dive with air and EAN50 to more than 66m. That would
have never switched to EAN50.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Subsurface supports currently 8 cylinders, thus we should not attempt to
add more.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't try to connect the globe when NOMARBLE is active.
Check exisistance before trying to open an image file.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If input is in F, we need to convert it to C on import.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Strangely, it still doesn't show the flag where it should be
(but it shows just after a reselect, so it's mostly a cache
issue somewhere)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we clicked in the globe and changed programatically
the text on the coordinates edit widget, the background
was still white instead of the bright yellow that it should
have to show that it was modified.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The accept method didn't save the gps edit even if we
put correct text on it.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now when the user selects the dive site edit, the globe
will enter in edit mode too.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>