Commit graph

23 commits

Author SHA1 Message Date
Dirk Hohndel
0f6b8a8f6f QML UI: DiveDetailsView - calculate better width and set everywhere
Even setting things up in the first row isn't enough. Every field in the
grid needs an explicit width. How dumb is that.

To make this more manageable calculate the correct widths at the beginning
and then just reference those properties.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 13:25:29 -08:00
Dirk Hohndel
3e46361518 QML UI: DiveDetailsView - set fixed column widths
In order for wrapping to work, the Text and TextEdit elements need to have
a defined width. Normally the GridLayout is supposed to be able to figure
out optimal widths for the different colums if you tell it which ones
should stretch, but that has repeatedly caused infinite loops and crashes
in the layout engine.

For now, in order to get both wrapping (and therefore no clipping of the
content) and avoid crashes, we hard code the width of the four columns by
setting Layout.maxWidth for each element in the first row of the grid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 12:44:01 -08:00
Dirk Hohndel
c6a844fbad QML UI: DiveDetailsView - reorder the grid
Let's put the three likely rather narrow items above each other in the
right column and the others (especially the three that could run long:
suit, buddy, dive master) in the left one.

Also, make the individual entries more consistent in which attributes are
set in which order - easier to read.

Finally, make sure that all grid elements enable wrapping.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 12:43:28 -08:00
Dirk Hohndel
e174389618 QML UI: another attempt to fix the random crashes
I finally was able to reproduce the crashes with the infinite recursion when
computing a GridLayout.

This seems to be triggered by competing Layout.fillWidth settings that the
layout engine couldn't figure out how to accomodate.

I did three things to make this work better:

- explicitly grab the columnWidth for the width of the DiveDetailsView.
- split the GridLayout in two so the area above and below the profile are no
  longer forced to fit in the same column widths.
- remove most of the Layout.fillWidth settings and only leave a couple that
  seem sufficient to get reasonable on screen layout in my experiments.

Here's hoping that this one is finally resolved.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 12:45:36 -08:00
Rick Walsh
fdd5ee507c QML UI: Another attempt to shift dive number to top row
Commit 1030cb265a 'QML UI DiveDetailsView: shift
dive number to right of top row' was reverted because it caused mysterious
crashes for some testers, inferred to be related to sizing items in a
gridLayout.

This patch brings the dive number back up to the right of the top row, so the
page width doesn't exceed the screen width. Using text wrapping should prevent
the date text and dive number items from increasing in width, and hopefully
avoids the mysterious crashes.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01 17:52:20 -08:00
Dirk Hohndel
cba50ece33 Revert "QML UI DiveDetailsView: shift dive number to right of top row"
This reverts commit 1030cb265a.

Simply trying to find out if this is the cause for the odd crashes one
tester is seeing.
2016-01-31 11:27:13 -08:00
Joakim Bygdell
9342dedb26 Move helper function to DiveObjectsHelper
As per Tomaz recomendation the helper functions from 19588ce and e072596
are moved from qmlmanager to DiveObjectsHelper.

[Dirk Hohndel: merged with the latest code]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 11:18:44 -08:00
Dirk Hohndel
140624918c QML UI: revert dive detail view layout changes
Now the layout flows again and shouldn't cause clipping on the right
(unless the user has excessively long, unbreakable words it seems.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 10:16:25 -08:00
Joakim Bygdell
e0725966b1 QML UI: Add helper function to get weights
Helper function that retrieved the total weight for a dive to be displayed
on the DiveDetials page.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 11:14:33 -08:00
Joakim Bygdell
19588ce139 QML UI: Add helper function to get cylinder info
Helper function that retrieves the cylinder description to be displayed in the
DiveDetails. Only the first cylinder for a dive is retrieved.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 11:14:30 -08:00
Joakim Bygdell
1c3a1433e4 QML-UI: Rearrange the DiveDetails page
After adding "Cylinder" to the DiveDetails page the objects had to be rearranged
in order to better utilise the space.
To get a cleaner look on smaller screens the left side is left aligned and the
right side is right aligend.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 11:14:28 -08:00
Dirk Hohndel
eef5bf75c3 QML UI: fix map display regression
In commit 6540e95425 ("dive details navigation") the change to access the gps
variable was only partially implemented.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21 12:23:07 -08:00
Dirk Hohndel
3116bc06fb QML UI: show date and time for dive
We keep losing the time when people move code around. date really is just the
date and doesn't include the time component.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-20 14:06:05 -08:00
Rick Walsh
1030cb265a QML UI DiveDetailsView: shift dive number to right of top row
In dive details view, shifting the dive number to the right of the top row
means it won't be cut short if the dive duration is 1 hr or longer

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 07:16:49 -08:00
Sebastian Kügler
53024ca76d try to fix profile scaling
Different approach here:

- profile gets a bit higher, this was requested on the mailinglist, and
  seems to behave much better with the painted profile, we'd otherwise
  get it magically clipped on the right hand side.
- Make the scaling dpi aware, this fixes scaling for me on the Nexus7, I
  haven't been able to test it properly on other devices, so this needs
  some more testing. The result is visually quite close to what we can
  do, although I'm still getting a somewhat larger margin on the right.
  To get at the devicePixelRatio without too much custom code, I've
  added a property to the QMLProfile to retrieve it from the theme engine.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13 16:27:41 -08:00
Sebastian Kügler
6540e95425 dive details navigation
This patch reworks the navigation of the dive details.

- The detailsview is now a list view with page-sized delegates. This
  allows horizontal swiping to the next and previous dive.
- The central button now allows to open the edit mode for the dive.

Original patch was done by Marco Martin, but needed to be reapplied by
hand.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-12 03:06:09 +01:00
Dirk Hohndel
ef653b41f5 QML UI: obtain a reasonable margin from QML
This will be used later in the positioning of the profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-29 09:50:47 -08:00
Dirk Hohndel
6b10c45b2f QML UI: mark locations with GPS data
In the dive detail view, if a location has an associated GPS location, show the
name of the location underlined so the user knows that tapping on it will open
a browser window with a map picture.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 13:33:11 -08:00
Dirk Hohndel
bf239e7c42 QML-UI: add hacky, useless way to show the GPS location of a dive
This is of course stupid and NOT what we want to do, but one could argue it's
better than nothing (well, not sure, whatever). If we have a GPS location
associated with a dive and you tap on the location name when showing the dive
details, it opens a static image of a satellite map with a marker for the dive
site.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 13:33:11 -08:00
Dirk Hohndel
3d7475b964 QML-UI: add dive date to the detail view
That one really bugged me...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-07 14:59:52 -08:00
Sebastian Kügler
25e83a11e7 Fix text clipping 2015-12-07 18:46:57 +01:00
Sebastian Kügler
04b6446e72 redesign dive details view
This change cleans up the layout optimized for viewing dive details. The
top part contains brief and essential dive info (location, depth,
duration, dive no.), then the profile, then a table with more details,
and finally the notes.

The goal here is to present the dive's data more efficiently and
attractively now that the edit part is factored out.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-12-07 18:46:57 +01:00
Sebastian Kügler
8cf4725742 split divedetails into view and edit parts
This splits the dive detail page into two modes: view and edit

- The edit part loses the profile (it's not editable anyway)

- The view part gets a new layout, friendlier for viewing

- Properties for diveNumber, duration, depth and weight are added

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-12-07 18:46:32 +01:00