Commit graph

1534 commits

Author SHA1 Message Date
Berthold Stoeger
9a0c5df744 statistics/mobile: set currentIndex of QML combo boxes
Use Q_PROPERTYs of the StatsManager to correctly set
the current index of comboboxes after a state changed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-01-10 15:16:52 -08:00
Dirk Hohndel
8f8ee5c589 mobile/statistics: add simple icon
This doesn't look great, but it's already part of the breeze-icons,
so it's very easy to add - and it's better than no icon.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-10 15:16:52 -08:00
Dirk Hohndel
0de26e44a5 mobile/UI: rewrite screen size logic
This has been a thorn in my side for a long time. The old code was
terrible and insanely fragile. The new code is really dumb and quite
fragile. So definitely an improvement?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-10 15:16:52 -08:00
Dirk Hohndel
eb2b0f0a3e mobile/statistics: add a statistics page on mobile
This adds a reasonably flexibile mobile page that tries to do the right
thing for both portrait and landscape mode. In order to get the most out
of a mobile screen, it's implemented in a way that always gives it the
full screen (it does so by emptying out the page stack and being the
only page shown - brutal, but effective).

This commit also contains a bunch of other random cleanups that didn't
really justify being in separate commits.

Parts of this was written by Berthold, hence the double SOB.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-01-10 15:16:52 -08:00
Berthold Stoeger
d77f254328 statistics: add a skeleton StatsManager class
In analogy to "QMLManager", add a "StatsManager" class,
which manages the statistics module on mobile.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-01-10 15:16:52 -08:00
Dirk Hohndel
c6f134a9b1 mobile: replace locationProvider with calls to GpsLocation::instance()
This makes it more obvious what we are doing. And won't make any difference
from a performance perspective.

Also converted the last call to connect using the old syntax to the new syntax.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-02 12:47:15 -08:00
Dirk Hohndel
5048a695aa mobile: turn GpsLocation into a regular singleton construct
Simply move the initialization of the logging function into its own method and
call that in the QMLManager constructor.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-02 12:47:15 -08:00
Dirk Hohndel
53b572f987 mobile: don't connect to applicationStateChanged signal early
We don't want to connect to this until all parts of the QMLManager object are set up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-02 12:47:15 -08:00
Dirk Hohndel
4ca40bc152 mobile/UI: consolidate to a single check box
It was very odd that we had two slightly different styled check boxes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
765c4f9704 mobile/UI: fix the logic to keep input visible
Using the y coordinate of the component directly doesn't work if we use
the component inside other components. Instead we need to grab the
position relative to the flickable.

The comment about needing the function for this to work seemed dubious.
So for now I've removed that function and am setting the position
directly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
d5a7ceb433 mobile/UI: trigger position check on focus
Doing this check every time we get a 'pressed' signal for the input
field seems excessive. We really only need to check when the input field
gets focus - that's when the OS virtual keyboard might open and hide the
field the user wants to edit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
bb1fb86f20 mobile/UI: don't show warning if text field is not in flickable
It's entirely reasonable to use the component in a context where we
don't have a flickable. Simply don't try to reposition things in that
case.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
7ed32e3a49 mobile/UI: ensure active input field stays visible
This reuses the logic we implemented in the SsrfTextField.

Eventually we will need to clean up the inconsistent names for these
elements.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
f503e5a9c2 mobile/UI: avoid pointless warnings
These can create quite a bit of noise in the log.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
685403ff47 mobile/UI: ensure that edited text is current
By removing focus from all input fields we can ensure that we have the
correct data reflected when saving an edited dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
0a88d9839c mobile UI: avoid circular dependency
The relevant text field names are different depending on whether our
combo box is editable or not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
2d6710bdef mobile/UI: use our small label template
This saves 66 lines of code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
2e26051bd6 mobile/UI: provide more structured debug output for dive edit
Instead of always showing info about the location, allow all data to be
captured in a more structured format - but only when the app is in
verbose mode.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
9d12ad2308 mobile/UI: don't try to set the combobox index
There's no point in doing that - we set the correct text and leave that
in the editText and displayText for the combo box. If the user uses the
drop down they can replace that. This works correctly for single people,
and for multiple people the drop down doesn't work at all, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
1771c39dd8 mobile/UI: don't show virtual keyboard when starting dive edit
When we start editing a dive the OS will open the virtual keyboard if
any of the input fields have focus (which they might get when we set
their content).
The explicit closing of the keyboard might be overkill, but also doesn't
appear to hurt.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
d6456d490f mobile/UI: add template for editable combo box
This makes the code easier to read and manage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01 11:35:39 -08:00
Dirk Hohndel
c62b8f3a75 mobile/UI: fix theming of About page
Can't believe I missed that one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
9621b88496 mobile/UI: improve theming of spin box
Those are used for the rating / visibility when editing dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
336decd30c mobile/UI: open dropdown on any tap for readonly combo box
This seems more intuitive. For editable combo boxes you need to tap on
the indicator, but for non-editable (readonly) ones, you can tap
anywhere and the dropdown is shown.
The code feels a bit clumsy, but seems to work in all cases.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
bda1f0b6e1 mobile/UI: slight visual change to combo boxes
They always have a 10% darker background, and show a border if the combo
box has focus. This seems to look reasonably well in all situation we
use them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
bae1529fb7 mobile/UI: repaint the combobox indicator on color change
It seems that now all elements are correctly re-colored if the user changes
theme.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
d9661a7be8 mobile/UI: initialize Kirigami theme to use our colors
With this we should finally get the correct button colors even when
switching color theme.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
4dc1b4ef4a mobile/UI: update location combobox for dive edit
This one was missed in commit

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
83acb98886 mobile UI: make TemplateComboBox selectively editable
Getting the visual right is really hard. The anchors seem to mostly work,
but it still doesn't look exactly right, IMHO.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
ee0ca3995e mobile/UI: fix trip details padding
Incorrect reference to the Kirigami Units.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 09:44:39 -08:00
Dirk Hohndel
a2b1266c15 mobile/UI: hardcore passiveNotification colors
I was convinced that I had fixed this while working on this set of patches,
but apparently I didn't. This simply hardcodes good colors.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21 14:10:48 -08:00
Dirk Hohndel
dbb6256b67 mobile/UI: make trip details edit theme aware
This got forgotten earlier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21 14:01:08 -08:00
Dirk Hohndel
052a46b562 mobile/UI: again, correct side button colors
I am confused how this worked and then got broken, but this appears to
once again fix the colors.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21 13:57:13 -08:00
Dirk Hohndel
40a0916de8 mobile/UI: stop using removed Kirigami interface
hidePassiveNotification() is no longer supported.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21 13:44:53 -08:00
Dirk Hohndel
bed11f79a1 mobile: remove non-functional code
This never ever worked to trigger a profile update. The code is
nonsensical as we cannot access the QMLProfile in a model delegate this
way from outside the delegate.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21 13:12:37 -08:00
Dirk Hohndel
1228dec19f mobile/profile: directly set up the diveId
The weird 'Component.onCompleted' always felt like the wrong way to do
this. Setting this directly from the model seems like the much cleaner
solution.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21 13:12:37 -08:00
Dirk Hohndel
f8b354d64d mobile/UI: remove incorrect code in ComboBox
This actually created a recursive dependency - I didn't see any negative
visual effect, but lots of annoying warnings.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 19:54:51 -08:00
Dirk Hohndel
7fc4ec1163 mobile/UI: fix theming of combo boxes in dive edit
Again, not using our template combo box.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 18:04:57 -08:00
Dirk Hohndel
4995c141c6 mobile/UI: make dive download combo boxes theme aware
In reality I should make our TemplateComboBox capable of handling the
modifications needed here without yet another reimplementation. Maybe
I'll do that next. This at least makes things look right.

A couple of odd whitespace changes snuck in at the end.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 17:20:02 -08:00
Dirk Hohndel
535a15e5fd mobile/UI: make filter entry / dives shown theme aware
Again, not using our text field / label (plus adding a subdued color for
the placeholder text).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 17:14:07 -08:00
Dirk Hohndel
68a15b8cdf mobile/UI: cloud credentials follow our theming
This was simply not using our labels / text fields, so it didn't pick up
our colors automatically.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 17:08:21 -08:00
Dirk Hohndel
494e5c5a34 mobile/UI: make passive notification easier to read
Once again I couldn't fix this without making changes to Kirigami.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 17:06:56 -08:00
Dirk Hohndel
43b5ac378a mobile/UI: fix context drawer header
Once again I couldn't fix this without making changes to Kirigami.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 17:06:34 -08:00
Dirk Hohndel
5979292469 mobile/UI: correctly theme combo boxes
Again, the fact that you basically need to completely reimplement the
ComboBox in order to change some colors is frustrating.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -08:00
Dirk Hohndel
fe283857e1 mobile UI: style check boxes and radio boxes
This is needed for the Export page.
And may I say for the record that it's rather surprising that in order
to change the color of one of those elements one ends up having to
completely re-implement them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -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
b3c80c5ae0 mobile/UI: use theme colors for startup text and location warning
This now looks right for the dark theme.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -08:00
Dirk Hohndel
3429552433 mobile/UI: correctly color the action button icons for dive list
This uses one of our fixes to Kirigami to allows us to set the correct
overlay color for our icons.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -08:00
Dirk Hohndel
0b52d7a398 mobile/UI: correctly color the action button icons for dive view
This uses one of our changes to Kirigami that allows us to set the
correct overlay color for our icons.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -08:00
Dirk Hohndel
86a4c5a0e5 mobile/UI: fix ActionButton icon coloring
This seems like a reasonably serious bug in Kirigami.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -08:00