Commit graph

1631 commits

Author SHA1 Message Date
Dirk Hohndel
503d8bd1fc mobile: don't quit on back button in Statistics mode
Fixes #3192

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Dirk Hohndel
2c04a1f297 mobile: tweak line spacing
When strings in dive details wrap, the line spacing is too tight
in some circumstances. While not perfect, this change improves
the situation somewhat.

See #3263

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Dirk Hohndel
9b669d91e0 mobile: add ability to edit tags
We already showed the tags, but we didn't allow the user to edit them.

This tries hard not to create inconsistent or illogical tags by trimming
white space and being careful with how the tags are added.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Dirk Hohndel
454207cd80 mobile: make cloud timeouts more consistent
In the mobile version we should always allow a little more wait time for
the cloud server - there just seem to be more issues with response times
on mobile devices, especially when in places with poor data reception
(which isn't uncommon for dive sites).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Berthold Stoeger
16b31985c3 cleanup: replace membuffer by membufferpp in C-code
Thus, the membuffer data is automatically freed when going
out of scope - one thing less to worry about.

This fixes one use-after-free bug in uploadDiveLogsDE.cpp
and one extremely questionable practice in divetooltipitem.cpp:
The membuffer was a shared instance across all instances
of the DiveToolTipItem.

Remves unnecessary #include directives in files that didn't
even use membuffer.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-07-23 11:22:43 -07:00
Dirk Hohndel
329fcf7fdc cleanup: update copyrights
That should have been done six months ago.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-07-03 14:28:37 -07:00
Dirk Hohndel
1dffe08f17 mobile/UI: show result of manual sync
Since we no longer show the noisy git updates to the user, it has become
harder for them to know whether a sync to the cloud was successful.
Since a manual sync will never show the new 'what did you change and
here's how you undo it' notification, it seems easy enough to simply
show a status update.

This adds a passive notification with no action button after the user
either uses the main menu or pulling down on the dive list in order to
trigger a manual sync.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-23 13:19:11 -08:00
Dirk Hohndel
64dea827bd mobile/debugging: copy GPS fixes to clipboard
The goal is to enable a user experiencing crashes when applying GPS data
to their dive log to make all necessary data available to the
developers. Hopefully the clipboard is large enough to hold all the
data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-23 13:19:11 -08:00
Dirk Hohndel
9be23b5f3f mobile/UI: correctly update title bar font size
Simply force it to use the default font, which is bound to the
application font, which we SHOULD be updating when changing the regular
font size for the app, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:48 -08:00
Dirk Hohndel
f678be0374 mobile/cleanup: make theme test page work in dark mode
Not really user visible, but still, that looked ridiculous.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:48 -08:00
Dirk Hohndel
35f1b9e204 mobile/statistics: force redraw after rotation
Sometimes (and it's unclear why that happens) after rotation the stats
widget is blank. Setting the first variable back to itself appears
enough to ensure that the statistics view is redrawn. Try to do that
programatically after a short delay.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:48 -08:00
Dirk Hohndel
5f6d223184 mobile/statistics: bare minimum dark theme support
The statistics themselves still are in a light theme, but at least the
rest of the UI now works in both regular and dark themes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:48 -08:00
Dirk Hohndel
da43bd096f mobile/kirigami: fix width of passive notification
If we have a button on the notification to trigger an action, we need to
make sure there's space for that button.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
126329ab7c mobile/UI: add button to change notification
This is fun... with just a tiny bit of 'magic text parsing' we can allow
the backend code to add a button to the notification that will open the
context menu that will make it super obvious to the user how they can
undo an operation.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
e1cb368437 mobile/UI: show notification with changes made after save
Since we save after every operation in the mobile app, this allows us to
tell the user what we actually saved - and we can remind the user that
they can undo/redo the last operation.

The code gets more complicated because in the case that the operation
that triggered this change was an undo, we need to show the redo text to
describe what we are saving, and must point the user to the redo
operation.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
fa8ac5ceeb mobile/UI: normally don't show git progress info to user
This isn't really useful for normal users and with the new 'multiple
notifications stay visible' feature in Kirigami it creates a really
weird and distracting user experience.
We should show the user a summart of what we did instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
bd951a51cc mobile/cleanup: remove outdated comment
In commit 24eac8df87 ("mobile: remove overwriting of line special case
in ui-notification") the code doing the line replacement was removed,
but the comment above that code wasn't updated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
274b3c786b mobile/git-storage: ensure correct commit messages get saved
In order to get the undo stack information into the commit message, we
need to actually call Command::init() to set up the callback.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
0a632e12d2 mobile/UI: move dive delete to context menu
Having this as the right action button (same one used for 'cancel' in
the edit screen) made it too likely to inadvertantly delete a dive. And
outside of testing, wanting to delete a dive really shouldn't be all
that common an operation. So remove the function from the action button
and place it into the context menu instead, right next to the undo
action so the user also is aware that there is an undo option.

Suggested-by: Peter Zaal <peter.zaal@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
1913e97bf2 mobile/statistics: fix layout warning
The filler element was placed incorrectly (in a position already used)
and worse the logic for its sizing was wrong.

This gets rid of a warning and creates the intended layout.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
a2bfeb0743 mobile/cleanup: fix cylinder visibility in dive edit
And wow isn't that a nice improvement in the code.

Also has the benefit of actually doing the right thing and not creating
unwanted white space for missing cylinders. And does away with all these
warnings about coercion (after all, we were checking against the wrong
value.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
e1c269f54c mobile/edit: fix broken screen repositioning
In commit 622e5aab69 ("mobile/cleanup: remove more noisy debug output")
I had good intentions, but missed the fact that in order to access the
'verbose' variable from QML I needed to use manager.verboseEnabled. The
resulting syntax error went unnoticed and broke the screen repositioning
when the keyboard opens on mobile devices.

Worse, I called a non existing method to do the logging of debug
information.

And to top it all off, when I fixed the positioning algorithm in commit
765c4f9704 ("mobile/UI: fix the logic to keep input visible"), I forgot
to fix the near identical logic for the TextArea for the notes.

Fail on so many levels.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
f29534e07f mobile/UI: update dive edit layout
This feels much more responsive to various screen widths to me.
Instead of a fixed grid this is now a Flow that is tries to make much
better use of the space available on the user's device. It's not always
perfect, but to me at least a massive improvement.

The commit is almost unreadable because of the re-indentation and the
move of a block of fields to earlier in the form (as that made it much
easier to flow everything). But with show -w you can get a better idea.

We have a Flow around all the fields, we pair each label with the
corresponding input field, and then have a few additional Flows to
ensure that the cylinders always start in the first column.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
da42c0b104 mobile/UI: simplify and cleanup Settings
This is both cleaner and looks better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:42:47 -08:00
Dirk Hohndel
74bb2c49bf mobile/UI: improve layout of styled ComboBox and TextField
This makes the TextFields (and the editable ComboBoxes with them) have a
tighter visual experience.

It also moves the indicater closer to the right edge in the ComboBox and
doesn't use preferredWidth for the slim combo box as that implies a
maximum width which could lead to unnecessary clipping.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:35:29 -08:00
Dirk Hohndel
9aa660e06e mobile/UI: don't change the window size when gridUnits change
QML and Kirigami trigger a change of our application window size if we
manually override the gridUnit. Which of course is NOT what we want, so
immediately undo that after changing the gridUnit to prevent bad side
effects.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:35:29 -08:00
Dirk Hohndel
cb71fb2822 mobile/UI: correctly scale UI without restart
The fact that the rescaling in the settings gave different results from
what we got after a restart really should have been a dead giveaway that
the code was fundamentally flawed.

With this, if the user picks smaller, regular, or larger they now always
get the same, consistent values for gridUnit and font sizes.

This also gives up on the idea that we can just force the gridUnit to be
smaller to make things work if the font (which drives the gridUnit) is
too big for a screen. That fundamentally cannot work and gives a
horrible UI experience. So instead simply warn the user and continue
with matching font / gridUnit, which will still give a bad experience,
but at least we told the user about it and didn't pretend this was ok or
fixable.

Finally, this gets the factors right when switching from smaller to
larger or back, without stopping at regular on the way.

One odd side effect of this code is that under certain conditions
(number of columns changes) the display window when running mobile on
desktop will resize. That's kind of odd, but as that is not /really/ our
target platform, for now I'd consider it acceptable. But it does deserve
more investigation.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:35:29 -08:00
Dirk Hohndel
323e97c603 mobile/UI: remember the system default font size
We need to do this before the preferences are loaded, or the system
default size is lost. Given that our other sizes are all relative to
this value, that would be a problem.

With this we can now ensure that we always have the right font size for
smaller, regular, and larger theme settings.

Also removes some obsolete commented out code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:35:29 -08:00
Dirk Hohndel
3469fa70eb mobile/UI: offer more font sizes
As it turns out, we used to get the font scaling completely wrong. As a
result we got got ~72% and ~132% instead of the intended 85% and 115%.
So now people have both options, in each case with matching gridUnit
(and therefore visual spacing), and font size.

Also visualize the font size by rendering the button text accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:35:29 -08:00
Dirk Hohndel
2c3d927a42 mobile/UI: don't double apply the font scale factor
The mobile scale code had a fundamental flaw: we applied the scale
factor once to gridUnit, but twice to the font size. So effectively we
had font sizes of 72% and 132% (all of course then rounded to integers
for no good reason) instead of the intended 85% and 115%.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:35:29 -08:00
Dirk Hohndel
4843ae4ede mobile/UI: add visualization of font size vs gridUnit
This seems harmless and obvious, but it shows that for the last however
many years our smaller/regular/larger font change was bogus and broken.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:35:29 -08:00
Doug Junkins
31e26fd144 mobile: add GF fields for ceiling calculation
Adds fields to the advanced preferences page to modify GFLow and GFHigh for
the Buhlmann decompression model for calculating ceilings. Updated preferences
code to set the Buhlmann parameters in core/deco.c when the GF prefs are
updated.

Signed-off-by: Doug Junkins <douglas.junkins@gmail.com>
2021-01-19 12:34:46 -08:00
Dirk Hohndel
622e5aab69 mobile/cleanup: remove more noisy debug output
The repositioning message when a virtual keyboard opens is useful enough
to keep it and just hide it unless in verbose mode. The others have all
outlived their usefulness.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-13 16:16:31 -08:00
Dirk Hohndel
702d09df9f mobile/GPS: fix two errors in the GPS handling
First, the time zone adjustment was wrong - this as written could only
ever have worked in UTC or by pure chance.

Second, the order of alerting the UI of the availability of a GPS fix
was also incorrect creating a race between the UI and our data
structures.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-13 13:52:00 -08:00
Dirk Hohndel
4454cf0381 mobile/statistics: allow chart selection for statistics
Based on a dummy commit from Berthold, this provides a styled popup of
the available chart types for the current variables.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-13 11:39:36 -08:00
Berthold Stoeger
12842f4a86 mobile/statistics: make charts model available to UI
Create a QML ChartListModel in the StatisticsPage and pass that to the
StatsManager on initialization.

[extracted from a slightly larger commit]

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-13 11:39:36 -08:00
Dirk Hohndel
e5c30e042b mobile/statistics: start with dives per year bar chart
That seems to be the most commonly usefule chart.

This also removes some noisy log messages; these were super useful
during development, but should have been merged.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-13 11:39:36 -08:00
Dirk Hohndel
22ffe59a60 mobile/statistics: fix layout issue in wide mode
After spending so much time trying to make things work well on smaller
screens I completely missed that there was an off by one error making
the statistics display way too small on larger tablets in landscape mode.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-13 11:39:36 -08:00
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
2784f390a1 mobile/UI: better sizing for Global Drawer header image
Especially on smaller screens in landscape mode (which is nice for
statistics) the image took up way too much space. Now it gets cropped in
a way that makes sure all the information text is visible, but not too
much space is stolen from the rest of the menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-12 08:31:35 -08:00
Dirk Hohndel
0cb533abcb mobile/UI: make the comboboxes slightly more modern looking
The smaller indicator and more rounded corners seem more pleasant.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-12 08:31:35 -08:00
Dirk Hohndel
871e29d031 mobile/UI: add another variation of the combo box
This one is designed to be fixed size and space efficient, non editable.
It's used in the statistics page for now and looks much better than what
we have elsewhere, so the style should propagate to the rest of them as
well, but this is trickier for the once that are editable - and of
course the fixed width might also not be appropriate in other places.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-12 08:31:35 -08:00
Berthold Stoeger
6c315eaf21 mobile/statistics: fix crash in dropdowns
The code was protecting against the wrong member being NULL.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-12 08:31:35 -08:00
Dirk Hohndel
5fe3b7c8c6 mobile/UI: add settings to display profile ceiling
So far only DC provided ceiling information was available and visibility
of that was simply inherited via cloud storage from the desktop.
With this the user can set both DC reported and calculated ceilings in
the advanced settings in the mobile app.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-10 15:57:39 -08:00
Dirk Hohndel
669cbdaac5 mobile/UI: add signal to redraw profile
This allows us to force a redraw of the dive profile when settings change
that require a refresh of the profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-10 15:57:39 -08:00
Dirk Hohndel
3cd795c71e mobile/statistics: small UI improvements
This gets us better log messages and better spacing - but it's far from
good and all of this should be squashed into one working version in the
end.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-10 15:16:52 -08:00
Berthold Stoeger
5cfa13694c statistics/mobile: add variable2 operations combo-box
Copy paste of the other combo boxes.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-01-10 15:16:52 -08:00
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
Dirk Hohndel
7ed861fb9f mobile/UI: better dive list color for dark theme
While the text name is 'light primary color' it really has to be a dark
blueish color to fit with the theme.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -08:00
Dirk Hohndel
d0d867d80a mobile/UI: correctly theme the global and context drawers
This requires more changes to Kirigami, but with this we get dark
drawers (the menus that slide in from the side) in the dark theme.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20 10:51:18 -08:00
Dirk Hohndel
6a5f83d7da mobile/UI: improve theming of title bar
We do theming very differently from what Kirigami intended. Mostly
that's because our code predates theirs. But also because Kirigami wants
and app to simply use an OS theme - whereas we want to be able to
provide different looks, independent from the OS theme.
Ideally we'd still use the existing methods to change the colors and
sizes of Kirigami UI elements, but for now this hack helps improve
readability of the title bar.

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