The asynchronous nature of the profile bites us here. plotDive() signals
that it changes model data and expects the rest of the data structures to
respond to that. Very neat and it seems to work perfectly well on the
desktop, but on Android calling render() right after plotDive() resulted
in paint() functions being called before all the elements had been
calculated as a result of the signals being emitted in the model change.
That's why so often the profile was missing parts.
Now admittedly this makes me nervous. Do we now know that all calculations
have finished by the time render() gets called? Not really. It just seems
that in my testing we tend to get lucky and things work out. But that does
not feel like a sane architecture to me.
Messing around with the animation speed is silly as we render the profile
into a pixmap, so let's turn this off globally.
Also, the scaling of the pixmap is still completely bogus.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
get_error_message() clears the error message in the process, so calling it
twice in a row does not do what you might think it does.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes spacing around the icon in the left drawer, the stretched-out
icons in the navigation menu, the unnecessary scrolling in the same
menu, and a few other things.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
- Use the component's heading for more consistency
- spacing between items: largeSpacing above, half of that below, this
makes the title visually connect to the widgets it refers to.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Using a normal checkbox, we get black text, not our styled Label. Since,
short of doing a style, this is the only way to get the label the right
color, and thus not screw up the visual appearance of the drawer, we
hand-roll it.
This is a bit clunky, but I prefer visual continuity here over code
complexity concerns.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Add a checkbox in the global drawer which allows quick access enabling
and disabling the location service. This is something the user wants to
keep an eye on, quickly enable it before a trip, so it makes sense to
give it some prominence. It also helps reminding that the user switched
the device into battery-monster-mode.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
The right hand side of the logo was slightly off of the left orientation
line for the rest of the layout. This changes it to Units.smallSpacing,
which is used for this kind of spacing.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This change makes the top bar a information/decorational item, not
interactive anymore.
- The menu at the top-right is redundant, it is provided by the
left-hand-side drawer and visually present through the botom-centered
control button.
- The back button is already provided on Android by default, swiping
back in the UI also works, so this button provides a third method to
go back -- that's overkill.
Less is more. Less top bar means more screen estate for the meat.
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>
This achieves two things:
- make the contents not seem crammed against the bottom
- allow the user to scroll the content above the drawer icon
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Simplify the default page in main.qml:
DiveList has everything needed, remove the outside
layout and the message bar
Signed-off-by: Marco Martin <notmart@gmail.com>
We've already ported everything to MobileComponents.Label, so this file
can be taken behind the barn, never to be seen again.
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>
Move the properties we previously added to units and theme into their
own container. This encapsulates these things that belong together and
allows us to move it out later without many problems. Also, litter the
global namespace a bit less.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This patch is the part implementing the drawers and in-app page
navigation. In more detail:
- main.qml uses the mobilecomponents plugin and the APIs as already
changed in the other components
- The extended properties have moved into the root item (for now,
they'll get properly encapsulated later)
- A menu can be swiped in from the left
- The application makes better use when used horizontally (if there's
enough space, so depending on the display you can get divelist and
-details next to each other, one phone/portrait formfactor, the layout
stays in a single column.
- The options for GPS have been grouped into a submenu
This change follows the Plasma mobile human interface guidelines. These
changes are actually relatively small considered what they're doing,
most of the logic is encapsulated in mobilecomponents' PageRow and *Drawer
classes.
The previous navigation pattern is actually a subset of this
one, so it still works.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This picture is used for the header part of the drawer which can be
swiped in from the left.
I'm sure Dirk has a better one, but this works quite nicely until he
gets to replace it.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This is a dumb port of a number of properties to use the new theme and
units API.
- import the plugin
- change accessors from units and theme to MobileComponents.Unit and
MobileComponents.Theme
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This adds only the bits from MobileComponent that we already use to the
qrc file, including two icons go-next and go-previous (2 simple SVG icons taken
from the breeze theme).
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This commit adds the .qml and qmldir files for the MobileComponents
import. It contains low-level things like units and theme, and mid-level
things like Heading, and high-level navigation in the form of an
ApplicationWindow and Drawers that hold menues and provide swipe
interactions between the pages.
These components are a more full version of the "light" plasma
components we have been using to make the UI scale well and appear more
consistent (coloring, spacing, alignment, etc.).
An interesting change is that Units and Theme are now singleton types,
which is more efficient. It does mean a few changes to our current API
usage:
- units becomes Units
- theme becomes Theme
- 2 properties move out of each (we can't subclass singleton types)
This change also means that we're using the vanilla upstream components,
so it's very easy to get improvements to these rather young components
in, and we don't have to do this work on our own.
The mobilecomponents consist of just a bunch of qml files which we can
deploy through the qrc file.
In the next commits, we will gradually make the current UI use these new
elements.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Testing the mobile application on Win32 desktop results
in a crash.
Using ApplicationWindow for some reason makes the executable
enter an inifinity loop on startup until it runs out of RAM.
The output is:
setGeometryDp: Unable to set geometry 160x1200+720+426 on ApplicationWindow_
QMLTYPE_12_QML_111/''. Resulting geometry: 160x885+720+426 (frame: 4, 23, 4,
4, custom margin: 0, 0, 0, 0, minimum size: 0x47, maximum size: 16777215x
16777215).
To fix the crash use "Window" instead of "ApplicationWindow".
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
ACKed-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this is primarily something targeted at a mobile device, with many
of the 2 in 1 devices it is possible that the user might be running the
desktop version of Subsurface on a mobile device.
As a first step to make it possible to collect GPS fixes on such a device
we need to make the infrastructure to do so available in the desktop
application as well.
This still needs to be hooked up in the desktop UI.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of directly using the status output for the QML UI, set up the
function used to display messages to the user as part of the constructor.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should actually not be in the mobile section at all. This needs to be
available on the desktop as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's just not user friendly to have two different user IDs for two
different web services that we provide. Instead in the following commits
we'll add a way to retrieve the location service web service userid with
your cloud storage user id.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now this always sends the default name for GPS fixes created by the
location service. There isn't much point in making this configurable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this Subsurface-mobile should be able to mostly replace the companion
app. This needs some more testing and fine tuning (for example the minimum
time / distance should be configurable, there should be a location name),
but I think the hard part is done now.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>