Commit graph

8 commits

Author SHA1 Message Date
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
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
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
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
113cb1acc0 Mobile: use appendTextToLog to get timestamps in logs
This helps tremendously when tracking down some problems. We should
never use console.log.

In the process this also updates a couple of the messages to be clearer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-03 04:02:00 -08:00
Dirk Hohndel
01f1bea995 Mobile: ensure input fields stay visible after keyboard opens
When the user taps on a TextField to enter text, usually the virtual
keyboard will pop up. This code tries to ensure that the keyboard
doesn't cover the entry field that the user was trying to work on.

In order to centralize these changes, this introduces a new
SsrfTextField type which we use to also remove a few redundant default
settings that we previously had for every field. The one TextArea for
the Notes field didn't seem worth creating yet another type for, so
there the changes are done directly in DiveDetailsEdit.

The awkward timer mechanism is necessary as the keyboard pops up
asynchronously and then triggers a change of height for the app, so we
need to wait a little bit before doing the adjustment.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 13:39:45 -07:00