Commit graph

19 commits

Author SHA1 Message Date
Dirk Hohndel
ee3482c109 mobile/UI: small adjustments, using the slim combo box
This changes most readonly combo boxes to use the smaller, more modern
looking TemplateSlimComboBox and makes some layout adjustments on a few
pages to overall create a better UI.

A lot of this is just cleaning up things that were rather rough in the
first place.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-12 08:31:35 -08:00
Dirk Hohndel
b0193f79d0 mobile/UI: fix dive summary for dark theme
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -08:00
Dirk Hohndel
1549d6f528 mobile/dive-summary: make the drop downs smaller
Especially on smaller screens we had issues fitting this on the screen.
And it looks fine on larger screens as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31 20:33:11 -07:00
Dirk Hohndel
f915c45c43 mobile/summary: remove some debug output
I don't think we need that anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-10 08:02:56 -08:00
Dirk Hohndel
4b3761861e mobile/summary: expand refresh button
Buttons ignore the width of the enclosed label and base their width on the
illogically named implicitWidth instead.

Also translate the button text.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-10 08:02:56 -08:00
Dirk Hohndel
57024d188c mobile/summary: more UI fine tuning
Creating more space for the header column and a little visual separation for
the different sections.

The commit is much smaller than it looks - try 'git show -w'.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-10 08:02:56 -08:00
Dirk Hohndel
6c7411c776 mobile/summary: use more intuitive time periods
No one will ask you about your dives in the last seven months (and the
existing code actually provided the past 210 days in that case). Instead
do more intuitive periods. Last month, quarter, half year, year.

Use Qt's ability to make sane date calculations easy.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08 10:29:36 -08:00
Dirk Hohndel
fb057b7094 mobile/summary: improve the spacing of the content
Use more idiomatic ways to indent the rows, replace the TemplateLabel with a
simple Label since drawing the extra rectangle for the background of the
TemplateLabel is obviously redundant and using it doesn't change the number
of properties we need to set.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08 10:29:36 -08:00
Dirk Hohndel
5f6b7450a9 mobile/summary: correctly align text to vertical center
I keep forgetting that the verticalAlignment is only within the current object,
which means that in a single line label it has no meaning at all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08 10:29:36 -08:00
Berthold Stoeger
feab249bf2 mobile/summary: add refresh button
On tablet devices, the summary page stays open and therefore
the summary is not refreshed. For now, add a button. Later, this
should be connected to signals when dives are edited, added or
deleted.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08 10:29:36 -08:00
Berthold Stoeger
a93c303b8b mobile/summary: add section headers
Add section headers to the dive summaries on mobile by adding
a section-property. Of course, this will not work on desktop.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08 10:29:36 -08:00
Berthold Stoeger
1809dbd00a mobile/summary: remove dive summary calculation
Since we now use a model to calculate the dive summary, there
is no need to export recalculation of the dive summary via
QMLInterface.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08 10:29:36 -08:00
Dirk Hohndel
a5823a5b0d mobile/summary: implement frontend code for the new summary model
Implements the ListView and its delegate to use the dynamic data
provided by the DiveSummaryModel

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08 10:29:36 -08:00
Berthold Stoeger
48ccd114fc mobile/summary: recalculate first and last dive on visibility change
Recalcluate not only the statistics for the given period, but also
the global first and last dive date.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08 10:29:36 -08:00
Berthold Stoeger
f7c73f1987 mobile/summary: implement firstDiveDate and lastDiveDate
Instead of transporting the global first and last dive date
in the dive summary, calculate it in an external function.
Since we already have time and date functions in qthelper.cpp
implement those functions there. Provide a stub in QMLInterface
so that QML can access these standalone functions.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08 10:29:36 -08:00
jan Iversen
a65ec77263 mobile-widgets/qml/divesummary.qml: detect change in units
When either length or volume unit is changed, the text needs to be
changed.

Let signal lengthChanged and volumeChanged cause a recalcation and therefore
new text.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-30 19:51:50 +02:00
Dirk Hohndel
08e39f9d2d mobile/dive summary: rewrite statistics code
There were quite a few issues with the code - clearly a complete failure of
code review.

- all values were '??' if a period contained no dives
- imperial units were not calculated at all
- significant truncation and data loss in the way totals were added as meters
  and minutes instead of the higher precision data that is available
- several issues in striing conversion methodology, e.g. missing zero padding
  for minutes
- missing maxSac
- incorrectly calculated avgSac
- incorrectly claculated number of EANx dives
- hard to read code with most variables named 'temp'

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-30 07:45:25 +02:00
jan Iversen
a534f1a25c mobile-widgets/qml: Fix Kirigami error.
Solve kirigami error:
INFO: qrc:/org/kde/kirigami/ScrollablePage.qml:187: TypeError: Cannot assign to read-only property "parent".

Kirigami.scrollPage does not allow a ListModel be defined, even though it is allowed in QtQuick.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-29 06:19:25 -08:00
jan Iversen
b6e86a1c70 mobile-widgets/qml: add DiveSummary.qml
Add DivePlannerSummary, a page to show in dive centers.

Allow user to select period for the 2 colums in DiveSummary.

Default is "Total" and "3 month", but allowing the user to change
these, make it a very simple tool to view how the user progresses.

Variables are taken from Backend.

[Dirk Hohndel: adjusted text strings as these aren't really months]

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-27 14:25:03 -08:00