Commit graph

50 commits

Author SHA1 Message Date
Sebastian Kügler
f4906abf59 Fix left margin in dive list
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>
2015-11-30 01:07:42 +01:00
Marco Martin
13f78743c6 Divelist has its own color
don't reassign DiveList color upon declaration
it's just redundant and error prone

Signed-off-by: Marco Martin <notmart@gmail.com>
2015-11-30 00:04:10 +01:00
Sebastian Kügler
b96f202f14 sync with mobilecomponents 67e73fa85e
Colors have slightly changed in breeze.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-30 00:03:02 +01:00
Sebastian Kügler
78d5325dda Simplify dive list items
- 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>
2015-11-29 23:59:49 +01:00
Sebastian Kügler
95c5b35583 Add a bit of spacing below the dive details
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>
2015-11-29 23:58:49 +01:00
Marco Martin
8e523329b6 fix contents size
correct childrenRect mistakedly called contentRect

Signed-off-by: Marco Martin <notmart@gmail.com>
2015-11-29 23:58:49 +01:00
Marco Martin
8646934ba3 Simple DiveList as initial Page
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>
2015-11-29 23:58:49 +01:00
Sebastian Kügler
609d138a49 sync with mobilecomponents' d3fa79b50b54
This fixes the flickering when the drag button hits the right edge.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 22:24:34 +01:00
Sebastian Kügler
33d589ff5c Add missing icon
This is the SVG file used on the drag button. Like the other two, it's
taken from the Breeze icon set.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 22:21:31 +01:00
Sebastian Kügler
e0fc5268fe Sync with mobilecomponents 54e4f2622a
This fixes loading the icon.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 22:13:52 +01:00
Sebastian Kügler
ffb2c6014e Remove obsolote Label item
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>
2015-11-29 22:13:52 +01:00
Marco Martin
32219f1276 Port the page navigation to ApplicationWindow's one
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>
2015-11-29 21:59:48 +01:00
Sebastian Kügler
3d3fce7152 Sync to mobilecomponents 67cf594b4ddc
Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 21:24:55 +01:00
Sebastian Kügler
6580f078d0 Fix reference errors caused by moving properties around
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>
2015-11-29 19:22:10 +01:00
Sebastian Kügler
8fad349c82 new container for extended theme properties
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>
2015-11-29 19:09:59 +01:00
Sebastian Kügler
5e5c9830a4 Sync with upstream mobilecomponents
This updates to the state of bf7914b67c45e

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 18:57:50 +01:00
Sebastian Kügler
6ffef818a8 Rework central navigation
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>
2015-11-29 17:51:14 +01:00
Sebastian Kügler
c302f222ce Add banner image for the left drawer menu
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>
2015-11-29 17:41:16 +01:00
Sebastian Kügler
3c1d7c0074 port these as well to mobilecomponents
Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 17:30:41 +01:00
Sebastian Kügler
2668da3f60 use mobilecomponents for our pages
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>
2015-11-29 17:27:20 +01:00
Sebastian Kügler
4d94441b6d Add new files to the qrc
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>
2015-11-29 17:23:47 +01:00
Sebastian Kügler
b59cdcd4d3 import mobilecomponents
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>
2015-11-29 17:13:13 +01:00
Lubomir I. Ivanov
daf8f36dd4 main.qml: fix crash on native Win32 desktop
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>
2015-11-19 07:55:00 -08:00
Dirk Hohndel
18e52c1da4 QML UI: remove manual setting of web service userid
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>
2015-11-18 13:12:34 -08:00
Dirk Hohndel
76d0763527 Location service: make distance and time threshold configurable
Right now the distance is always in meters, the mobile app doesn't deal
with units at all, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14 09:10:06 -08:00
Dirk Hohndel
df6c73d503 QML UI: actually store the userid setting
Forgot to hook this up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14 09:07:14 -08:00
Dirk Hohndel
7afed04520 Location service: upload GPS fixes to webservice
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>
2015-11-13 17:21:43 -08:00
Dirk Hohndel
577da54454 Location service: add ability to delete all stored GPS fixes
This may need an "are you sure" confirmation dialog...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-13 17:20:45 -08:00
Dirk Hohndel
d65b756c4f QML UI: add preference for webservice user id
This handles the user id for the Subsurface webservice for GPS location
tracking.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-13 17:15:28 -08:00
Dirk Hohndel
4b39971978 Location service: apply the saved GPS fixes to dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-12 20:23:00 -08:00
Sebastian Kügler
973b68c304 Fix label overflow in divelist
- 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>
2015-11-11 19:06:07 -08:00
Sebastian Kügler
6e43642610 Rework divedetails page
- Styled texts
- don't put all the properties of the text items in one long line, makes
  the code more readable and is in line with coding style used
  throughout.
- button and profile move into their own items, button moves to the
  right (it's more of a contextual item, so it's better placed top
  right, further more, a control is generally easier to reach on the
  right without covering information unnecessarily. Code-wise, it's also
  a more logical encapsulation.
- dpi-aware sizing of dive profile, use units.gridUnit instead of
  hard-coded pixels.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 19:05:27 -08:00
Sebastian Kügler
b50202bfc5 Use styled text items in divedetails
Using Label instead of text gives us consistent coloring and styling of
the text labels. Also remove the boldness to make it comply to the
design language used.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 19:05:20 -08:00
Sebastian Kügler
91b951c362 Simplify anchoring in divedetails
anchors.fill does essentially the same, as the item is positioned at 0,0
of the parent by default.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 19:05:10 -08:00
Sebastian Kügler
63cde0e120 dpi improvements for small text
- 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>
2015-11-11 19:04:26 -08:00
Sebastian Kügler
ac1607dce2 kill warning
This line seems to be a left-over from a refactoring. It doesn't do
anything, just produces a warning, so just remove it.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 19:04:13 -08:00
Dirk Hohndel
62f7ec11d7 Location service: store locations in settings
This is rather simplistic and will clutter the settings. I'm not convinced
this is the BEST way to do this, but it's a rather straight forward way to
get persistant storage of the location fixes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 15:28:10 -08:00
Dirk Hohndel
cd7d6ae6e5 Location service: toggle the service from the main menu
That way we don't track the user's location until explicitly asked to do
so.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 15:28:10 -08:00
Joakim Bygdell
9c5c97b449 Android: remove duplicate top bar from log window
The log page have an extra top bar that is not needed.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:46:28 -08:00
Sebastian Kügler
bfe24526d3 fix startpage appearing over dive list
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>
2015-11-07 15:51:09 -08:00
Sebastian Kügler
9ff701069d Flip visibility when opacity is 0
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>
2015-11-07 15:32:03 -08:00
Sebastian Kügler
a0a3bf8870 Improve labels in login dialog
We want short labels here in order to allow more horizontal space to be
taken by the inputs.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:04:35 -08:00
Sebastian Kügler
ff82d1cc15 Improve TopBar and login window layout
This provides a bit more spacing around the logo and aligns the text to
the bottom of the logo, rather than to its horizontal center. Looks
cleaner.

Text in the login page is now aligned towards the inputs, giving a
closer connection between label and widget.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:04:22 -08:00
Sebastian Kügler
09b7ebf28b tighter margins on start page
We use units.largeSpacing margins for page-level spacing.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:04:10 -08:00
Sebastian Kügler
2b70b76133 Rejig navigation
This change streamlines the navigation across the pages to be in line
with the stackview organization. The top bar becomes a static element
with the title and a button that either opens the preferences or shows
the back arrow.

This makes it a bit more efficient, since we load the title bar only
one, and there are no strange animations in the title. The stackview
gets the role of content container, the "chrome" around it is laid out
in main.qml.

Most of the churn in this patch comes from moving large blocks of code
between files with different indentation levels.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:03:47 -08:00
Sebastian Kügler
0e26afbf0a Remove hard-coded size from label component
This isn't necessary anymore with the default font size fixed, remove
it. The label itself is still useful for coloring, and perhaps more
styling in the future.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:03:20 -08:00
Sebastian Kügler
cc032c9830 Clean up dead code in units
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:03:01 -08:00
Sebastian Kügler
6b886f0da2 Improve 1st start experience
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>
2015-11-07 09:02:48 -08:00
Sebastian Kügler
6dfac6a081 Improve layout of login dialog
- Add margins consistent with other pages
- Top-align the dialog, we want to keep the inputs as high as possible
  on the screen to prevent the on-screen-keyboard from covering them
- Add a checkbox to show the password, with input on mobile devices,
  this is a commonly found and useful feature
- Remove Cancel button, this is just navigation chrome, the user can
  simply use the back button in the top bar (will be fixed in a
  subsequent patch)

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:02:20 -08:00
Sebastian Kügler
aae4a326f4 organize qml files in subdirectories
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>
2015-11-07 09:00:59 -08:00