Commit graph

593 commits

Author SHA1 Message Date
Lubomir I. Ivanov
4808f5f9b6 mapwidgetcontextmenu: add a model delegate for the ListView
The ListView delegate is a simple Component with a parent Rectangle.
It contains a text field with the ListView action.

This patch also defines some properties for the delegate animations
and looks. The property maxItemWidth tracks the width of all item
text, and makes the width of all items be of that value.

The above prevents potential issues when a fixed width item is used
and some translated language string cannot be fit inside of it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
eeb53e965e mapwidgetcontextmenu: create a ListModel for the context menu
Menu item indexes are enumerated in the object menuItemIndex, while
menuItemData, holds an array of objects which will define the number
of items, with indexes (idx) and text (itemText).

When the ListModel is created, it's dynamically populated from
from menuItemData.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
7dfb168f7f mapwidgetcontextmenu: position the contextMenu on the map
The anchor of the menu itself will be positioned near the edge of the
map widget, while the menu contents will have negative coordinates.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
de73cf1c90 mapwidgetcontextmenu: add an Image for the context menu toggle
- add the PNG file into the QRC
- add a simple scale animation for the Image on click

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
70a8402911 mapwidgetcontextmenu: add placeholder QML
This QML component will be used to provide a context menu for the
QML map widget. Include the file in QRC and test it's creation
in MapWidget.qml.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
b0cf820bef mapwidget.qml: move the new map type toggle on top of the map
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
09a0f74bd8 mapwidget.qml: animate the map type toggle image on click
Add a SequentialAnimation that performs a slight animation of the
toggle image scale.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
8487873029 mapwidget.qml: add an small icon (top-left) to toggle the map type
Clicking the image toggles the map.activeMapType value from type
STREET to type SATELLITE.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
468f3b57c0 mapwidget.qml: simplify the map type enumeration into "mapType"
Make the "enumeration" local to the Map object for now.
This will possibly break if another plugin is used in place of the
ESRI plugin, but it will simplify the map toggle button which is about
to be implemented next.

If support for multiple plugins is added on runtime a simple
helper function will be needed that will check the current plugin "name".
And return the appropriate supportedMapTypes[X] for e.g. STREET of that
plugin.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
8b22435809 qrc: add a couple of images for the map type toggles (satellite/street)
The QML based map will have a toggle in the top left corner to toggle
between the satellite and steet tiles.

The images are created specifically for use in this Qt Location widget
and are free for use in Subsurface.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
88c6d98265 qrc: yet another slight rename for the map markers resources
Use a "mapwidget-" prefix for both the QRC and the file names.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
ce309c15a7 mapwidget.qml: use a seprate animation for zooming out
The animation sequence when deselecting a zoomed in map location, should
be:
- zoom out completely
- pan to center

To achieve that a new animation object is created - "mapAnimationZoomOut"
The previous zoom in animation is renamed to "mapAnimationZoomIn".

The map functions centerOnMapLocation() and deselectMapLocation()
now call the helper functions animateMapZoomIn() and animateMapZoomOut().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
6aa57ce7f7 mapwidget.qml: reduce the properies in mapAnimation to single lines
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
11eaea01dd mapwidgethelper.cpp: call deselectMapLocation() in QML
If a divesite doesn't have a GPS location we want to deselect
the currently selected markers and zoom out the map. In the Map
QML object the function deselectMapLocation will handle that.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
250fc1e03f mapwidget.qml: don't use the onSourceChanged() slot for flag animation
It's best to only animate the flags when clicked, thus play the animation
in the onClicked() slot from the MouseArea.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
23c56b3c31 mapwidget.qml: add deselectMapLocation()
When called this function will zoom-out the map and set it's center to
(0, 0)

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
3e3b4baee2 mapwidget.qml: remove some redundant "map." references
Inside the Map object, properties can be referenced directly.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
a8f6c99fc0 mapwidget.qml: add the animateMapTo() helper function
To be used to center the map on a dive location or reset the map
if a dive from the dive list doesn't have GPS coordinates.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
033eec9500 mapwidget.qml: use map.newZoom and map.defaultZoomIn
When centering on a map location, use the predefined zoom
map.defaultZoomIn.

Later the map should be able to center on (0, 0) and zoom-out
if a dive doesn't have GPS data.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
6299a3c93b mapwidget.qml: whitespace and ';' cleanup
The rest of the QML code in subsurface doesn't use the ';' to
end a line of code or a declaration. Remove all the redundant ';'.

Also clean extra blank lines.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
2d101b7252 mapwidget.qml: play little animation on marker clicks
If a marker is clicked it's source image changes, which will
call the onSourceChanged() slot. If a marker is selected
play the newly added sourceItemAnimation which is a short scale
animation for the image.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
24d5485a88 mapwidget.qml: update the Z order of selected markers
If a marker is selected bring it up front (high Z value) else set
it behind everything else.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
6c640158e8 mapwidget.qml: add some properties for zoom and center
These properties will be used when zooming-in on a map location
or when zooming out if no map location is selected.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
b4740803a1 mapwidgethelper: pass a MapLocation object to QML in centerOnDiveSite()
The function in QML centerOnCoordinate() is now renamed
centerOnMapLocation() and accepts a MapLocation object, so that
a marker is selected (based on UUID).

In MapWidgetHelper::centerOnDiveSite(), the pointer to a MapLocation
is retrieved via MapLocationModel::getMapLocationForUuid(). Added in the
previous commit.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
a920d683a1 mapwidgethelper: add a slot to handle marker selection from the model
When MapLocationModel updates the selected marker, MapWidgetHelper now
receives a signal. The slot is named selectedLocationChanged().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
f2608edc56 mapwidget.qml: track the marker selection
Add a MouseArea to the MapItemView delagate and onClick set
the "mapHelper.model.selectedUuid" to the uuid of the clicked marker.
This updates the "selectedUuid" property inside MapLocationModel.

Based on "mapHelper.model.selectedUuid" it is now possible to
show two seprate images for selected / deselected markers.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
a9c0abd71a maplocationmodel: add a "uuid" property to MapLocation
The "uuid" property will be the one from the dive_site. At first it
will also be used to track the active marker/flag selection.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
ea5221bcf0 qrc: use a separate image for the selected and unselected markers
The image for the unselected marker is now a slightly darker flag.
Same behaviour as the current Marble implementation.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
476670cb8d mapwidgethelper: pass a QGeoCoordinate to the QML map
Rename the QML function "centerOnCoordinates" to "centerOnCoordinate"
and pass a QGeoCoordinate to it in ::centerOnDiveSite().

This will prevent the creation of a QGeoCoordinate object on the
QML side and instead it will be created in C++.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
de90480b46 maplocationmodel: use QVector for the MapLocation storage
QVector is faster, use it for "m_mapLocations" instead of QList.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
6ed807f52d maplocationmodel: add the addList() method
This method should be used if many markers are added at once.
It's main purpose is to reduces the number of beingInsertRows()
calls.

Make MapWidgetHelper::reloadMapLocations() use it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
ffb92111e5 mapwidgethelper: add the reloadMapLocations() method
reloadMapLocations() is the method which is called when the list
of markers (model) should be cleared and re-populated with new MapLocation
objects.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
f44645b6fe maplocationmodel: store the coordinate as QGeoCoordinate
Instead of maintaining a seperate latitude/longitude values
in C++ and passing them to QML separatelly, pass them as a QGeoCoordinate.

This reduces the number of model "roles" and also prevents the creations
of extra objects in QML (e.g. via QtPositioning.coordinate(..)).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
d783984443 mapwidget.qml: implement the MapItemView with delegate
MapItemView is the QML class that handles the "create map markers based
on a model". In this case the model is created as part of the
MapWidgetHelper, so here passing "mapHelper.model" to the "model"
property is enough.

The delegate receives coordinates from the model as "model.latitude",
"model.logitude" and converts them to QGeoCoordinate.

The "sourceItem" image for the delagete is just an image ATM and is
fetched from QRC.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
a50e9866d5 qmlmapwidgethelper: maintain an instance of MapLocationModel
The idea here is that the QML code should be able to fetch a model
from the MapWidgetHelper instance which is instantiated inside the
QML code; fetch it in the lines of "mapHelper.model".

This way, updates at the backend would be reflected on the Map QML widget.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
2cb8fee827 add the SPDX-License-Identifier to new source files
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
0678e5936c mapwidget.qml: implement some map animation
When calling centerOnCoordinates() the map will now animate over a
period of 3 seconds the zoom level and over 2 seconds the center
of the map.

Can be tweaked and improved later on.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
5f2e60142a mapwidget.qml: add the function centerOnCoordinates()
This function can be called to center the map on a specific coordinates.
For the C++ version call it via QMetaObject::invokeMethod() in
centerOnDiveSite().

TODO: add QML property animations.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
5cc2c02dfb qmlmapwidgethelper: add the centerOnDiveSite() method
MapWidget sould not handle any of the map backend.
Instead it should just pass calls to MapWidgetHelper.

Do that for centerOnDiveSite().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
c68536ec56 qmlmapwidgethelper: remove stray test() method
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
5266a5e84b MapWidget.qml: reference the Map object in the MapWidgetHelper object
The idea here is that the Map object can be controlled from C++ via
the "m_map" private member. Also, for the mobile version, QML code can
call the same C++ methods (if marked as Q_INVOCABLE).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
118a3b9804 qmlmapwidgethelper.h: add a "map" property with m_map MEMBER
This is about to be used to reference the QML Map in the MapWidgetHelper
C++ class.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
0d75dec0fa MapWidget.qml: create an instance of MapWidgetHelper
This instance in the QML code itself will be accessed by both the
mobile and desktop version. That way, the map code between
the two Subsurface versions will be shared.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
f5882362d3 mobile-widgets: add the helper class MapWidgetHelper
The idea with this class is that it should be used by both the mobile
and desktop version.

TODO STEPS:
1) the class should be registered in both the mobile and desktop version
with qmlRegisterType<MapWidgetHelper>...
2) the MapWidget.qml should create an instance of this class.
3) this way the helper will be part of the QML and both the desktop and
mobile version can have access to it.
4) the desktop version as a first implementation can just use findChild()
in desktop-widgets/mapwidget.cpp.
5) desktop-widgets/mapwidget.cpp on the desktop should just translate
calls from the rest of the desktop-widgets to this helper class.
6) the mobile version access to this object would be easy but is off the
scope for now.
7) the idea, when implementing the desktop support is to make it so
that when implementing the mobile version later, no or only minimal
changes would be required to the MapWidgetHelper class.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
ccaaff42a3 mapwidget.qml: enumerate the ESRI map types of interest
Add a local "enumeration" (object) for the two possibly map types
of interest: SATELLITE and STREET.

Use SATELLITE by default.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
e9d4bdcf4e map: use Item instead of Rectangle in MapWidget.qml
The root element is now an Item and also doesn't have explicit
anchors and dimensions as these will be handled by the parent:
- on desktop: a QQuickWidget
- on mobile: any QML based QQuickItem

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
42980e51d3 map: add new marker resource image
This new marker image is free for use in Subsurface. Custom made
in CorelDraw and Photoshop.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
a73a56284c map: add placeholder MapWidget.qml in mobile-widgets/qml
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Jan Mulder
e6ee87efec Revert "QML UI: color the status bar correctly"
This reverts commit d22f67925e.
2017-07-28 07:30:44 -07:00
Dirk Hohndel
f3271c973f QML UI: remove obsolete debugging code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-26 06:31:14 -07:00
Jan Mulder
bb7dcc25c7 QML UI: remove "show password" switch and only show pw on first entry
Like the subject says. We do not want the password to be made
visible, so a switch to show it, is useless and is therefore
removed. Futher, the entry mode is set to PasswordEchoOnEdit,
which causes the passwd to be visible (for easy entry), but
can't be made visible again after save/end edit.

Fixes: #512

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26 22:30:43 +09:00
Jan Mulder
e1e1c4b650 QML UI: remove some dead code
Removed some unused alias defines.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26 21:57:11 +09:00
Jan Mulder
d22f67925e QML UI: color the status bar correctly
In commit e9503cfa3d re-coloring of the status bar was
forgotten. Added here.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26 21:57:11 +09:00
Joakim Bygdell
1ebd7dd430 QML UI: add missing id line in our button
The missing id line in our own button generates an error in log and makes the buttons to fat.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 14:13:22 +09:00
Joakim Bygdell
25fd8c1727 QML UI: use a lighter text color for the selected dive
Use the ligther text color on the secondary row of text when a dive is selcted in the divelist

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 14:13:22 +09:00
Joakim Bygdell
e9503cfa3d QML UI: use primaryColor instead of darkerPrimaryColor
In most places we wrongly used the darker primary color instead of the primary color.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 14:13:22 +09:00
Joakim Bygdell
0e0b5cee22 QML UI: replcae the "map it" button
Replace the "map it" button implementation with our own button.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
9d2c4dcd3c QML UI: replace button on DC download page
Replace the generic buttons on the DC download page with our own.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
4bcbe8e3a0 QML UI: add our own styled button
Add out own styled button as resource.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
ae33422ede QML UI: replace all checkboxes with our own
As per title, helps simplify theme modifications.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
fe425924e4 QML UI: add our own styled checkbox
Add out own styled checkbox as resource.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
071db08b14 QML UI: replace all switches with our own
As per title, helps simplify theme modifications.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
93ec03105e QML UI: add our own styled switch
This adds a switch styled for us, size is about the same as the material default.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
d803d3e63c QML UI: display gps fix icon in the global drawer
Kirigami prevents us from altering the color of the gps icon in the action menu. So let's display an gps fix icon in the lower left corner of the drawer when the location services is running, colored to match the themes primary accent color.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
a981c3d7c1 QML UI: add colored version of the gps location icon
This adds colred versions of the Material ic_gps_fixed icon, in our primary blue and pink colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Jan Mulder
fd03621a4b Mobile: honour location service time threshold
Independ of the settings, the threshold to reset the GPS data was
hard coded to 5 minutes. Now, honour the entered (and updated during
a session) time to refresh the GPS data in the location service.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-25 22:12:19 +09:00
Miika Turkia
97b770b837 Error message on mobile cloud credentials
Display proper error message when cloud credentials are incorrect.

See #481

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-25 10:04:20 +09:00
Dirk Hohndel
04213e1f03 QML UI: Download from DC: tell user if BT is disabled
This makes much more sense than displaying "No dives"

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:51:48 -07:00
Dirk Hohndel
be8eedb773 QML UI: Download from DC: move label next to buttons
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:45:55 -07:00
Dirk Hohndel
442ba66822 QML UI: remove obsolete comment
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:32:21 -07:00
Dirk Hohndel
8c0a1c2e6d QML UI: better list of downloaded dives
Not the lsit is much more compact and shows a lot more dives even on
smaller screens. And it's similar in style to the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:30:05 -07:00
Joakim Bygdell
b9e90441ca QML UI: replace theme checkboxes with switches
Replace the theme checkboxes on the settings page
so that we get a unified UI.
These switches are linked and as such can only be activated
deactivation occurs when the user selects another theme.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 23:47:22 +09:00
Joakim Bygdell
d51fe03bd9 QML UI: move location services to GPS menu
Move the location services switch to the GPS menu, indicate both with icon and text if the service is active or not.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 23:47:22 +09:00
Joakim Bygdell
3b3f6b67f5 QML UI: fix copy paste error
The credential status has nothing to do with GPS functionality.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 23:47:22 +09:00
Joakim Bygdell
2187ef6c90 QML UI: fix typo
Simple typo on the overlay drawer.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 23:47:22 +09:00
Dirk Hohndel
686b87e903 QML UI: Download from DC: respond to click on checkbox
Strangely, a click/tap anywhere else worked as expected, but if you hit
exactly on the checkbox, the status change wasn't propagated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
05a3bbe65c QML UI: Download from DC: remove unused property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
e49a3b01ab QML UI: save credentials as they are bein entered
We removed the action button for saving on the Settings page, so credentials
never got saved.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
680022aea5 QML UI: don't disclose the current password
This isn't perfect, but at least it doesn't disclose a password that
isn't currently being edited.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
a03aa44821 QML UI: fix typo
And remove line that's commented out.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
a24e49361d Add README explaining icon licenses
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 11:26:06 -07:00
Joakim Bygdell
1659390a54 QML UI: simplify settings page code
In stead of using the fixed 4 column code introduced in f2fcad89b0db9b164d8fd3f89218ad27ca362bd3 use percentages of page width to allow for a more flexible layout since no block really has 4 columns.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
a80394d5b6 QML UI: make the theme settings not overflow page width
As per title.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
f96dacc94d QML UI: remove the save button from settings page
As per title.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
ee210c3bcd QML UI: enable auto-save on settings page
Automatically save changes made on the settings page on completion of text fields or theme checkboxes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
bc0f473908 QML UI: merge all GPS settings in one block
Put all GPS settings in one block and revert to a 2 column layout while maintaing the 4 column widh.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
a56e98ffc6 QML UI: Replace checkboxes on settingspage with switches
Replace the checkboxes for location services and developer with switches.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
a5d43bc5f8 QML UI: fix typo
Simple typo fix.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Rick Walsh
213f68d922 Mobile settings: stylize switches
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-07-23 03:20:58 +09:00
Rick Walsh
8d2b59ff31 Mobile Settings formatting
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
6655b37add Mobile: consolidate settings to one page and menu entry
Addresses: #492

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>

Had a bit of rebase issue with this one.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
e80132cdef QML UI: move location service to preferences page
Move the locations service switch to the GPS section of  the preferences page.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
98268a0c7e QML UI: add icons to the GPS menu
As per title.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
5739294c07 QML UI: add icons to the dive management sub-menu
The title says it all.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
72c5125b2e Add more icons
New icons for the dive management  sub-menu
ttps://material.io/icons/
The icons are under Apache License Version 2.0

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
8419a19810 QML UI: add icons to global drawer
Add an icon to each item in the global drawer

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
71b6b8e043 Add material icons
Add a couple of icons from the material repository.
https://material.io/icons/
The icons are under Apache License Version 2.0

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
a66d876ed0 QML UI: add checkbox to show/hide developer menu
Add a checkbox to the preferences page to facilitate selective visibility of the developer menu. With the coresponding function in qmlmanager.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
0eef27376a QML UI: reorder the items of the global drawer
Change the order of the items in the global drawer and change the name of some of them.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Jan Mulder
6f8e50f860 QML UI: fix some obvious UI errors
Fixes: #490 items 1) and 2).

1) Reference to isBluetooth.leftPadding is removed as the isBooltooth
checkbox is gone.

2) Do not set background color of downloaded dives. The checkbox is used
to denote "selected or not".

In addition, incorrect references to subsurfaceTheme.PrimaryColor (which
does not exist) are replaced by the correct subsurfaceTheme.primaryColor.

Finally, an obvious copy/paste error width: childrenRect.height. that
is supposed to be width: childrenRect.width.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19 21:52:22 +09:00
Jan Mulder
619fbaf1e2 QML UI: Allow cancel of ongoing download
This commit adds the capability to cancel a running download from DC.
The actual cancel is fully handled in the underlying libdivecomputer
code. As the user may be interested in the dives downloaded up to
the moment of cancel, do not just close the download screen (as
it was before this commit). Now, the <quit> button changes to
<cancel> when the download is started, and pressing cancel, only
cancels the download and does not close the download screen, but
presents the so far downloaded data. When no download is running,
the <quit> button just quits the screen as before.

Fixes: #485

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19 21:49:37 +09:00
Jan Mulder
915b760d54 Android: truncate logfile and add date
Trucate the logfile on open to remove any data from previous sessions.
This confused me very much, as the new logfile started from the
top, leaving old data on the bottom.

Also added system date for easy reference.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19 11:13:03 +09:00
Joakim Bygdell
c1e0324d95 QML UI: set the color of the action side-buttons
This sets the color of the action side-buttons to the same color as the overlay drawer.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
bb3387f234 QML UI: Download from DC: remove Bluetooth checkbox
The connection already clearly defines whether this is Bluetooth or not.
No reason for the separate checkbox.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
0104d7444e QML UI: Download from DC: smaller font for connection
Also style all three drop downs the same (otherwise the left edge of the
text doesn't align).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
025efc12d4 QML UI: remove the Paired Bluetooth Devices virtual vendor
We now actually handle connections in a sane manner and don't need
that workaround anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
c7e284369a Merge branch 'MobileUI' of git://github.com/jbygdell/subsurface 2017-07-17 07:39:48 -07:00
Dirk Hohndel
695be281c0 QML UI: automatically set the Bluetooth checkbox
I wonder if we even need this anymore at all as the connection
clearly determines whether this is a BT download or not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17 07:36:44 -07:00
Dirk Hohndel
ec1b22b487 QML UI: only change connection when finding a match
If we can't find a match, just leave it unchanged. This way, if we
mis-recognize a device, the user can correct the product (or even
vendor) without losing the correct connection.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17 07:35:22 -07:00
Dirk Hohndel
40223c8a5f QML UI: show the connection choices in Download UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-16 21:53:44 -07:00
Joakim Bygdell
a4e3a4cb25 QML UI: style the GPS fixes page
Add styling to the GPS fixes page.
The background color of the swipe list objects is wrong and also the icon overlay. This is a Kirigami issue.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 18:21:03 +02:00
Joakim Bygdell
03a52b37bc QML UI: add material theme controls
In order for the theme styilng to work we need the materials definitions.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 18:11:34 +02:00
Dirk Hohndel
7f49ba745c Fix compile errors
This was fixed in my local tree but I forgot to amend the commit
before pushing it out. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15 08:17:05 -07:00
Joakim Bygdell
4a1b675b86 Fix typo
Simple typo.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:36:37 +02:00
Joakim Bygdell
c0a9426ad3 QML UI: add Kirkigami theme variables
The built in theme in Kirigami has special variables for sertain objects, this sets the correct color for each object to match our themes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:35:40 +02:00
Joakim Bygdell
745e29958a QML UI: define the material accent colors for each theme
THe editable textboxes rely on the material theme to set the correct colors. This sets the appropriate colors for each theme.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:33:52 +02:00
Joakim Bygdell
1f20350849 QML UI: style the overlay drawer
This adds separate colors for the overlay drawer background for light and dark themes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:31:55 +02:00
Joakim Bygdell
0c31167e72 QML UI: style the GPS services checkbox
This adds style to the GPS services checkbox so that it matches the theme.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:28:58 +02:00
Joakim Bygdell
b889bf117d QML UI: style the DC download dialog
This sets the checkboxes in the dive computer download dialog to match the rest of the theme.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:27:34 +02:00
Dirk Hohndel
a0c6ceeb3d QML UI: enforce rules for cloud credentials
Email addresses are checked for a someone useful pattern, passwords are
letters, numbers, and +-_. only. Reject anything else.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-14 22:41:25 -07:00
Joakim Bygdell
60b64ceca4 QML UI: Hide map it text if no coordinates exists
This hides the text for the map it button if ther are no coordinates for a dive. Needed as for the dark theme the map it text was still visible.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-14 16:28:50 +02:00
Joakim Bygdell
2ecd7e58d4 QML UI: Change the pink color
This changes the pink primary color to match the tone of the blue primary color.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-14 15:44:45 +02:00
Joakim Bygdell
9f3a565601 QML UI: Add right handle icon
This adds the right handle icon that is needed for the swipe list items not to report an error when activated.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-14 15:41:04 +02:00
Joakim Bygdell
2f0873a7c1 QML UI: Don't use black for dark theme
This sets the background color to the recommended hue for dark themes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-14 15:37:59 +02:00
Dirk Hohndel
b7b2e813ad QML UI: only offer BT checkbox if BT is available
Right now we need to restart Subsurface-mobile in order to detect
Bluetooth devices - so simply turning on BT after Subsurface-mobile was
started is not sufficient.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-12 04:16:39 -07:00
Dirk Hohndel
2c111bb4cc QML UI: make BT state available to QML
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-12 04:14:24 -07:00
Dirk Hohndel
d233725519 Whitespace change
No code change at all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 21:11:37 -07:00
Dirk Hohndel
3a7ecc1a7f QML UI: make Preferences page scrollable
This commit only has the actual changes, the next commit will clean up
the white space in order to make it more obvious what was done.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 21:11:37 -07:00
Dirk Hohndel
6422932c61 QML UI: correctly wrap devinfo message
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 21:11:37 -07:00
Dirk Hohndel
7b922a1f72 QML UI: actually write libdc logfile
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 18:23:16 -07:00
Dirk Hohndel
dbb5826f2a QML UI: add preference for libdivecomputer log
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 18:08:36 -07:00
Dirk Hohndel
0a0c93e3b7 QML UI: add variable for libdc logfile
It seemed cleanest and easiest to have this in the QMLManager and
not in the DCDownload object.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 18:08:06 -07:00
Dirk Hohndel
ff659396c3 QML UI: fix typo in color values
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 18:06:12 -07:00
Dirk Hohndel
c59a74029b Android: write appLog to file
The trick is to pick a path that is accessible from other applications.
In theory QStandardPaths::GenericDataLocation should provide that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 17:40:29 -07:00
Dirk Hohndel
9111ce01e7 QML UI: show progress messages on the download page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 16:07:48 -07:00
Dirk Hohndel
8e0895e429 QML UI: Download from DC: disable misleading UI elements
These buttons only work when we successfully downloaded a dive. Also, don't
show a list of dives when there are no dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 16:07:03 -07:00
Dirk Hohndel
fd96daca6a QML UI: add progress message variable
To be shared between C/C++ and QML code in order to show the updates
and potential error messages from libdivecomputer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 15:07:44 -07:00
Dirk Hohndel
d2a5bf87c4 QML UI: add dev_info data to AppLog
This should make it easier to tell how far we get downloading data
from dive computers.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 12:50:22 -07:00
Joakim Bygdell
22a0ebe45d QML UI: Style the gps checkbox
Style the gps checkbos on the dive edit page so it follows
theme coloring.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
4698b86b13 QML UI: Style the radio buttons
This styles the radio  buttons in the preferences pane
so they follows the theme colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
4c4b72853c QML UI: Style the BT download checkbox
Style the checkbox to the themes primary color

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
aa5060669c QML UI: Style Dive Details View
Change the accent colors in the dive details view
to match the theme colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
b9a05e501b QML UI: Style DC download buttons
Style the button in the DC download dialog so they follow
the theme colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
12ac75c7dd QML UI: Proper button color
Make the "map it" button follow the theme color.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Dirk Hohndel
b1f4a2975f QML UI: better icon for download from dive computer
Thanks to Davide for paying for professional icon design.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-08 10:29:10 -07:00
Dirk Hohndel
c9c9a8390a QML UI: start BT discovery a tiny bit later
This way the AppLog starts with the name and version of Subsurface-mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-06 09:34:37 -07:00
Dirk Hohndel
ce21c2a696 QML UI: drop AppLog title and add margin instead
The title was hidden under the title bar, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-06 09:34:37 -07:00
Dirk Hohndel
282698e5d2 QML UI: disable reachability mode
Latest Kirigami master allows us to turn off reachability mode. In
general this had been rather confusing to our users and it seems to
somewhat conflict with the pull down to refresh of the dive list.

Latest Kirigami also changes the behavior of refresh slightly, you now
need to pull "down" for at least 500ms before it triggers. So, with this
change and the latest Kirigami, hopefully the user experience for
refresh is good enough that we can consider keeping it enabled and use
it as an equivalent to manual sync (even in offline mode).

See #454
See #456

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-29 15:10:42 -07:00
Jan Mulder
d6446569af QML UI: only drag a pull down sync, and not flick it
Fast flicking to the top of the divelist triggers almost certainly a
pull down sync, as the default boundBehavior is DragAndOvershootBounds.
Despite being the default QML action, this leads to unwanted pull
down syncs (even in offline mode).

Setting the boundBehavior to DragOverBounds solves this issue. Now,
the user has to explicitly drag the top down to force a pull down
sync, and a accidental fast flick is stopped at the upper bound.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-29 23:21:55 +09:00
Dirk Hohndel
b459ccbff7 QML UI: DiveList: make download from DC main action
Now that we support this for many dive computers, that seem reasonable.
I'm not happy with the icon, but couldn't figure out a better one in the
breeze icon set.

See #426

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-27 22:18:26 -07:00
Dirk Hohndel
77f545b38e QML UI: Download from DC: move accept button to the right
So it doesn't conflict with the hamburger menu button / opening the
global drawer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 16:12:45 -07:00
Dirk Hohndel
4963b27f52 QML UI: Download from DC: avoid assignments of undefined values
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 16:12:07 -07:00
Dirk Hohndel
fc2ca3a804 QML UI: DC Download progress indicator
For now just do an indeterminate busy indicator - we can get more fancy
and use the libdivecomputer progress event, later.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 15:52:07 -07:00
Jan Mulder
03badea06f QML UI: make toast message translatable
Restyle construction of toast message and enable translation for it.
Further, removed newline characters as they break the lines at
non-logical positions.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-25 13:56:04 +09:00
Dirk Hohndel
d93280f1dc QML UI: DiveList: add date box to trip header
This way you can tell when a trip happened.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 13:13:04 -07:00
Dirk Hohndel
49a368539a QML UI: set opacity of 1 for dive list
Hopefully with this we get exactly the right colors.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 11:19:56 -07:00
Dirk Hohndel
e3cd6719c1 QML UI: Davide's colors for the blue theme
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 11:18:18 -07:00
Dirk Hohndel
94bc756391 QML UI: Theme colors: fix bad typo
Here I confused myself with "dark" theme and the "darkerPrimary"
colorls...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 21:36:59 -07:00
Dirk Hohndel
206df227f8 QML UI: remember the theme
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 19:49:57 -07:00
Dirk Hohndel
26b206af1f QML UI: show a small color palette preview
When picking which color theme to use, show the user how things will look.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 19:49:57 -07:00
Dirk Hohndel
8ba581a088 QML UI: use textColor instead of diveListTextColor
This color is used for more than just the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 19:49:57 -07:00
Dirk Hohndel
694e833f90 QML UI: move theme setting into preferences
And reorganize settings and preferences a bit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 18:48:41 -07:00
Dirk Hohndel
dac9ce578b QML UI: clean up the setting of theme colors
Let's have names for the colors in each theme and assign those
named values to the theme colors when switching themes. This
way other pages can access the colors that are not in the current
theme (for example for a theme switcher).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 18:48:41 -07:00
Dirk Hohndel
3f055ac9cb QML UI: set color of the action button
This requires Kirigami master past 2.2.0 (which explains commit 001ff1b9
"QML UI: switch to Kirigami master").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 08:44:55 -07:00
Dirk Hohndel
57e365222b QML UI: color the status bar on Android
This code is based on code from Marco Martin from the Kirigami Android
sample app. In order to simplify the QML code the QMLManager function is
there for all OSs, but it's a no-op on anything but Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 08:42:45 -07:00
Dirk Hohndel
b1f7e3eae2 QML UI: add missing go-up icon
Now the 'Reachability' feature should be more obvious.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22 09:05:43 -07:00
Dirk Hohndel
ea218b9d24 QML UI: DiveList: allow trip header to wrap
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22 04:19:23 -07:00
Rick Walsh
d9cb65cbed QML UI: turn off spinner if pull-down-to-refresh fails
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22 04:19:23 -07:00
Dirk Hohndel
28490d5dd0 QML UI: DiveDetails: add more space at bottom
This way the user can scroll up the page to see all of the notes without
having them covered by the action button.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 18:33:27 -07:00
Dirk Hohndel
a7fca80a3e QML UI: don't access dive without modelData
Occasionally I see errors in the log where we would access modelData.dive
with modelData = null. This patch addresses a couple of the spaces where
this happens, but also simplifies the code by using the existing alias.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 17:20:07 -07:00
Dirk Hohndel
7b7294d127 QML UI: DiveList: implement pull down to refresh
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 17:20:07 -07:00
Dirk Hohndel
e0f46b033d QML UI: attempt to add dark theme
This isn't great, yet, but a first step to show that this is possible
(and in doing so I found quite a few spots where the colors weren't
correctly propagating, yet).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 17:20:07 -07:00
Dirk Hohndel
8f2fc84ae7 QML UI: simple attempt to allow color scheme switching
By making the assignments to the Kirigami Theme colors Qt bindings
things get correctly updated when switching.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 14:01:30 -07:00
Dirk Hohndel
71d9aafcd6 QML UI: Linus requested Hot Pink as color scheme
He started the project, he gets to have his color preference.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 13:34:15 -07:00
Dirk Hohndel
4651454557 QML UI: don't reduce opacity for background of selected dive
Now that we have distinct colors for trip header and selected dive, this
is actually counter productive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:53:19 -07:00
Dirk Hohndel
02d8c98c93 QML UI: DiveList: always show current trip at the top
This is especially nice for very long dive trips.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:48:29 -07:00
Dirk Hohndel
9ddd26ff37 QML UI: redo all the colors
Naming them the same way Davide named them in his emails and assigning the
color values he proposed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:05:36 -07:00
Dirk Hohndel
16f16f6818 QML UI: DiveList: fix position of delete button
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:01:37 -07:00
Dirk Hohndel
c775fcebec QML UI: DiveList: turn the color blob into a thin line
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 09:55:03 -07:00
Dirk Hohndel
fc4153f8ac QML UI: make title bar taller again on Android
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 09:29:24 -07:00
Dirk Hohndel
d7be3b21d6 QML UI: DiveList distinguish trip and selected dive
Making the selected dive's background less opaque prevents confusion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 09:28:40 -07:00
Dirk Hohndel
1d32ebd657 QML UI: use Android palette colors
These were picked from
https://material.io/guidelines/style/color.html#color-color-system

One could argue that we should use different colors for iOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 22:51:25 -07:00
Dirk Hohndel
d1ed9c310f QML UI: remove files we no longer use
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 22:49:41 -07:00
Dirk Hohndel
fd5cd5ebf0 QML UI: DiveList: playing with different colors
Make the accent color much lighter, don't have a solid bar on the left
for dives that are part of a trip.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 16:21:47 -07:00
Dirk Hohndel
7a6f87405a QML UI: disable the MouseArea
Visible doesn't even make sense...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 13:28:46 -07:00
Dirk Hohndel
20dae442ad QML UI: DiveDetailsView add button for map
Implementing another suggestion from Davide. A button to get the map
(as well as just tapping on the location name).

Fixes #431

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 13:28:46 -07:00
Dirk Hohndel
7ccda01e7e QML UI: DiveDetailsView: make key dive info consistent with dive list
Remove the grid layout and replace it with code that is derived from the delegate
that we use in the dive list. In order to look proportional I ended up using a
larger font for the location and therefore decided to allow that text to wrap
instead of forcing single line.

This implements a good chunk of another one of Davide's great
suggestions.

See #431

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 13:06:29 -07:00
Dirk Hohndel
cbcb43247e QML UI: DiveDetailsView: make the lower section less busy
This removes fairly redundant text (yes, we know those are the Dive Details) and
makes the label for the Notes consistent with all the other labels.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 11:59:51 -07:00
Dirk Hohndel
4f34513277 QML UI: DiveDetailsView: move profile into bottom layout
Then we can remove the main layout and create a similar look as we now have
in the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 11:57:14 -07:00
Dirk Hohndel
d941384fb6 QML UI: DiveDetailsView: don't underline location
Davide points out that this is not a commonly understood way in an app
to indicate that a text is also a link. So let's just remove that (but
tapping on the location will still work to get you to the map if there
is GPS information available).

See #431

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 11:07:09 -07:00
Dirk Hohndel
4a2e21cf7b QML UI: log the font in use
This shows that we are, indeed, using Roboto on Android. Which means I
can close the first of Davide's design issues:

Fixes #427

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 11:00:01 -07:00
Dirk Hohndel
157e14e11d QML UI: DiveList: some fine tuning of sizes and spacing
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 10:05:45 -07:00
Dirk Hohndel
712d1e97f3 QML UI: DiveList: remove space below trip heading
That made sense before we had the shaded background, now it just looks terrible.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:25:07 -07:00
Dirk Hohndel
edd0d2f2bb QML UI: DiveList: don't show empty trip heading for dives without trip
We need to hide the left bar and background rectangle as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:14:05 -07:00
Dirk Hohndel
a93e3b26d6 QML UI: DiveList: show left bar on dives that are part of a trip
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:13:12 -07:00
Dirk Hohndel
a6a9eaa998 QML UI: DiveList: add blue bar on the left to trip heading
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 08:29:06 -07:00
Dirk Hohndel
684354ab6e QML UI: re-indent DiveList code
No actual changes besides whitespace.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:49:11 -07:00
Dirk Hohndel
e49301ea21 QML UI: DiveList: add background color to trip heading
In order to make it easier to see the changes, the code hasn't been re-indented.
This will be in the next commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:49:11 -07:00
Dirk Hohndel
3d8f61fe6c QML UI: turn DiveList heading into label
This way it will render in the same font as the location of a dive.
This will look like crap until the next commit adds a rectangle with
color around it, but this way it's much easier to see the individual
changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:45:16 -07:00
Dirk Hohndel
3d707dca9a QML UI: make the dive list heading slightly smaller
Again, the goal is to make this list look better and be more space
efficient.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-18 18:05:18 -07:00