Create small visible separation from the dive trip before. And make the dive
trip header a slightly different color so they stand out between dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes it MUCH easier to deal with a lot of dives.
Instead of needing a more complicated model we simply use the meta data that
allows us to create the dive trip sections to hide (make invisible + height 0)
all dives that aren't in the selected trip.
I'll admit that this was much easier than I expected it to be.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We received suggestions from users to darken the text color in the dive
list a bit and this does seem to be a lot more readable. Especially since
people are likely to use this outdoors the higher contrast seems
reasonable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is more consistent with the rest of our UI
To make this work you once again need changes to the mobile components
that aren't upstream, yet.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This doesn't quite work yet as the start page appears to miscalculate its
height (the cloud credentials page appears to be missing).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With the integration of the credentials into the start page the logic for
this has changed.
Since the code for start page and dive list is actually on the same page,
using opacity to switch between the two sub pages (depending on whether we
have valid credentials and dives to show), the old way of changing
credentials no longer worked.
With theis patch the user once again can change their credentials (and
change their mind and go back to the dive list).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Warning M126: == and != may perform type coercion, use === or !== to avoid it
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The fix for correctly showing multiple trips with the same location text
inadvertantly broke the detection of empty location text.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The way sectioning of the dive list works is by watching for different strings
in the section.property. In order to be able to tell different trips apart we
combine the address of the dive trip variable with the location (which will
create a new section for a new trip, even if the location text is the same) and
then strip that information out before showing the trip header.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a multi-part message in MIME format.
After fixing the regression (commit 9e9d220c98) strange double dashes
appeared in the Divelist headers for trips. Just suppress it.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- Apparently, QMLProfile doesn't like being painted without being
visible, when flicking quickly through the dives I would get empty
rendered profiles. Setting the cachebuffer to zero fixes it, and saves
some memory.
It still has some unfortunate timing, the profile gets rendered
mid-flick, which leads to a delay in the flicking motion, quite
annoying. We will have to somehow make sure that new profiles are
rendered after flicking, not during
- Smallish cleanups
Signed-off-by: Sebastian Kügler <sebas@kde.org>
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>
In commit 25aa80846b ("Move Dive class from qthelper.h/cpp to it's own file")
the meaning of getting the "date" of a dive was changed to just be the date and
not the date and time. That's not what the QML code expected.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Small error was introduced in commit 25aa80846b. The dive.location was
shown in the DiveList instead of the intended dive.number
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
and rename it to DiveObjectHelper, since it should be an QObject
based class to make it easier on the QML, grantlee and widgets
side to display the dive's internal data.
each Q_PROPERTY defined in the DiveObjectHelper.h file
can be acessed directly via it's name.
So, if you are on a model that returns a dive, acess it's name
by dive.name
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- flickable is gone, Page now just takes the children items, meaning we
can remove this assignment
- BasicListItem is factored out, and we now need it in our qrc
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This increases the rather conservative value for the maximum velocity of
the divelist to scroll at max 5 screens per second, meaning it's about 4
times faster. I've picked this value after a bit of testing, it can
surely be tweaked, but feels nicer already.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
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>
Spacing around pages is half a grid unit, as consistent with (some of
the) other pages. For the dive list, it's slightly more complicated:
We want the list items to reach the edges on both side as to increase
the interactive area. We have to apply the spacing left and right inside
the listitems. This patch does that.
Another consistency fix with other pages is that we're now adding a
header at the top of the dive list, which scrolles with the list view.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
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>
Specifying a negative margin means that we negate the margin that the
ListItem so carefully figures out for us, don't do that.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
- Replace the custom text items with the Components' label
- Remove now unneeded properties
The goal is to use less different font sizes, as to give the listview a
calmer and more uniform look.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
The ApplicationWindow component has an internal PageRow for the
management of the application's pages, use that instead of an
own StackView.
Use shared components for common things in the app
ListItem for the dive list
Page for application pages, for correct background color
and moving of the action button
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This makes things like accent(Text)Color and our two custom point sizes
for fonts resolve correctly again.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
- anchor the label to the left of the date field
- elide the text instead
This fixes the bug in the dive list where the dive's location overflowed
over the date, especially visible on phones in portrait mode.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- word-wrap and style the log message at the bottom, this should fix
clipping of error messages down there
- introduce units.smallPointSize, which defines a small font size to use
for toned-down display elements (e.g. the date in the dive list)
- No need to assign the default value to Text.text
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use the view, rather than the model to check if the list is empty. This
allows us to use the property notifiers rather than a function call, and
hence fixes updating the visibility of the startpage when the listview
gets filled (or emptied).
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes sure we don't accept any input from the startpage when
interacting with the divelist -- they're really mutually exclusive.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit adds a start page that is shown when there are no dives in
the list, for example when the user first starts the app. Instead of a
large empty screen, we offer 3 ways for the user to get dives onto the
device: download from cloud storage, dive computer and adding dives
manually.
This fills in the empty space in the dive list, and isn't a top-level
item since it really just makes sure the user isn't greeted with a big
empty space, which looks pretty unpolished, but rather guided through
the first steps.
Needs aligning of the naming in the actions.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes the organization of the qml files a bit more fine-grained, it
prevents mixing of .cpp and QML files, and also of what's compiled, and
what's included in the app as qrc data.
In particular:
- subsurface specific QML items go into the qml/ subdirectory
- theme and unit definitions to into qml/theme subdirectory (they
already were located in a theme directory)
- generic components, such as our Label goes into qml/components
This facilitates sharing of functionality and identifying common stuff
better. Ideally, we can pull qml/theme and qml/components from a
standardized set at some point, so we don't have to maintain that code.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>