Commit graph

542 commits

Author SHA1 Message Date
Rick Walsh
1409521eb2 DiveList.qml: set detailsWindow index before deleting dive from list
This appears to fix the mystery crashes that can occur when deleting a dive
from the dive list.

Fixes: #497

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-08-10 09:06:44 -07:00
Joakim Bygdell
3f1a20cbaa QML UI: GPS: remove header
Being the only page that still has an on page header
it makes sens to remove it.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-07 00:52:32 -07:00
Joakim Bygdell
e4d4718bae QML UI: GPS: remove margins
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-07 00:52:32 -07:00
Rick Walsh
7e4ba965d1 DiveDetailsEdit: make sure model data exists
This gets rid of TypeError messages, but does not appear to affect behaviour
qrc:///qml/DiveDetailsEdit.qml:254: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:228: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:216: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:204: TypeError: Cannot read property 'dive' of null

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-08-07 00:51:51 -07:00
Lubomir I. Ivanov
00e401b61f mapwidget.qml: add menu action for selecting visible locations
MapWidgetContextMenu now has a new action (SELECT_VISIBLE_LOCATIONS),
that will invoke the MapWidgetHelper method selectVisibleLocations().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
5db2460168 mapwidget.qml: implement centerOnRectangle()
First, this function calculates the zoom out effect until both the
current Map center and the target rectangle are visible - see the
"calculate zoom out" part.

Then it calculates a zoom level, so that the target rectangle
fits the viewport, but also so that the zoom is not too much (clamped).
see the "calculate zoom in" part.

NOTE: "centerStored" (the variable used to store the current map center)
is created using QtPositioning.coordinate(), because the code needs a new
object and not a reference of the map.center QGeoCoordinate object.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
0fc9a3bf4a mapwidget.qml: add a couple of helpers
Add stopZoomAnimations(), which is really just a precaution
function to make sure we have stopped all animation of the
map before doing calculations! Since the animation *should*
be running in a separate thread, this would make sure the Map "center"
and "zoomLevel" properties do not change.

Add pointIsVisible(), which is a helper to determine
if a point created by map.fromCoordinate() method is inside
the viewport. fromCoordinate() has to be called without the
"false" (clip) flag for this to work.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
d421660f91 mapwidgethelper: support tracking of all selected dive sites
MapWidgetHelper::centerOnDiveSite() now checks if more than
one dive sites are selected and finds the most top-left and
bottom-right ones in the coordinate system to form
a rectangle.

It also supports the special cases where a selected dive site
does not have coordinates or the case where only a single dive site
with GPS coordinates are selected.

TODO: implement mapwidget.qml::centerOnRectangle()
This QML function will receive a QGeoCoordinate based rectangle which
has to be centered in the viewport with animation.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
6fb841887d mapwidget.qml: add better error reporing on a missing map plugin
For instance, if the 'googlemaps' geoservices plugin is missing
a new message is now shown:
"qml: MapWidget.qml: cannot find a plugin with the name 'googlemaps'"

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
aea1cc4b8a mapwidget: use "satallite" maps instead of "hybrid"
Do so until the following issue is resolved:
https://github.com/vladest/googlemaps/issues/9

With the satellite map ([1]), the black tiles at relatively high
zoom levels over the Red Sea cannot be seen. Instead it shows white
tiles at the ultra-maximum zoom level at places.

As a side note, the "satellite" map does not have the country labels
which the "hybrid" map has.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Dirk Hohndel
0476f6dc18 QML UI: Settings: remove more margins
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 16:00:09 -07:00
Dirk Hohndel
c004e31dc2 QML UI: CloudCredentials: better use of space
No idea why this was restricted to be so narrow. Also, making
the font of the label smaller and lighter seems visually more
pleasing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 15:31:23 -07:00
Dirk Hohndel
c043366b8f QML UI: remove unnecessary margin
This makes better use of the available space.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 15:30:32 -07:00
Dirk Hohndel
ada6a0d664 QML UI: remove unused code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 15:29:50 -07:00
Dirk Hohndel
2b9523dcff Merge branch 'googlemaps' of git://github.com/neolit123/subsurface into googlemaps 2017-08-02 18:53:52 -07:00
Joakim Bygdell
bc1a388952 QML UI: dive edit autocomplete
This makes sure that the autocompleting comboboxes never displays the scroll list where the user can pick an entry, and as such forces the view of a autocompleting textfield from the users point of view. The reasoning is that when scrolling in the drop down list it it possible to scroll to far and thus abort the ongoing edit by flicking away the edit page.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
a9348607e7 QML UI: add more width to dive edit page
Mobile devices hare rather limited when it comes to screen size,
there is no point in reducing the availabel space more than neccecary.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
29e704a1b2 QML UI: loose focus on endEditMode
This handles a cornercase where a user starts editing and then cances the divedit followed by a return to edit mode. The previously acive textfield would then be active again even though all changes are lost.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
bc7d11860f QML UI: make sure textfields loose focus
For some reason the textfields on dive edit page did not loose focus when editing ended by press on the return key.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
97f1dc0b01 QML UI: autocomplete objects should lose focus on selection
When the user makes a selection using the autocomplete function while editing a dive the keyboard should close and the selection list should disappear.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
9e9e06aed6 QML UI: decrease fontsize on dive edit
Decrease the fontsize of the static text on the dive edits page.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
6a47af2d16 QML UI: enable modification of ratings
This enables editing of visibility and ratings for a dive.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
9d7eb33a33 QML UI: display rating and visibility stars
Display rating and visibility stars on the dive details page. See #495

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
ee17d54753 Add star icons
Add star 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-08-02 18:49:47 -07:00
Lubomir I. Ivanov
5cb1d28861 mapwidget.qml: use a custom built googlemaps plugin
This patch makes use of the geolocation plugin "googlemaps"
for Qt Location with source code from here:
https://github.com/vladest/googlemaps

The change from the ESRI plugin is that it requires new indexes
for the Hybrid ([3]) and Street ([0]) map types.

There are more zoom levels in this plugins, but our default zoom-in
settings seem to transition well to it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-02 00:51:12 +03:00
Robert C. Helling
757985bf2a Smaller buttons on map widget
... so they take up less space while still being clickable.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-07-31 16:55:12 -07:00
Dirk Hohndel
855dd0d1aa QML UI: stop showing location labels earlier
We are stepping by 2 - so 11 makes it clear that at 12 the labels are
shown, but at 10 they are not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-31 12:57:07 -07:00
Lubomir I. Ivanov
69f8fc3c5b map: whitespace cleanup in QML and C++ files
- remove ";"s
- remove {} where not needed or move them to the same line

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
591c4bfcca mapwidget.qml: track the coordinatesChanged() signal in QML
The C++ side for the desktop version already does that. Add a slot
for that in QML, for later use in the mobile version.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
f6896c3b8e mapwidget.qml: use darker text color for the deselected markers
Use "lightgrey" instead of "white" for deselected markers.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
5270688483 mapwidget.qml: add new logic for zooming and editing support
The editing support is added via dragging. It is handled via the
MouseArea's drag.target of the MapQuickItem. The drag target changes
with the model selectedUuid.

"mapAnimationZoomIn" now also does an initial zoom-out before moving
to a new location.

centerOnCoordinate() now pefroms calculations to determine how much
the animation needs to zoom out. What it does is it reduces the Map
zoomLevel util both the current and the new target coordinates are visible.
It then restores the zoomLevel and performs animation based on newZoomOut.

animateMapZoomIn() is now obsolete.

The patch also includes the following smaller changes:
- remove the setSelectedUuid() call in deselectMapLocation()
This is now handled in C++
- sets "defaultZoomIn" to 12.0
- use ">=" when determining if a mapItem text should be visible

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
3589e2e952 mapwidget.qml: add visual tracking of editMode from MapWidgetHelper
The MapWidgetHelper QML instance now has the slot onEditModeChanged()
which toggles the visiblity of a newly added message box that
notifies the user if editing mode is enabled.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
ff4924f650 mapwidgethelper: change centerOnDiveSite()
Call setSelectedUuid() from C++ also center on coodinates instead
on a MapLocation, as there is no point to pass the MapLocation object
back to QML.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
f7095aa89e mapwidgetcontextmenu: slight increase of element size
Increase the font and element height a little to make it
easier to click.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
f2a8bab01e mapwidget.qml: include map location text
The MapItemView delegate now includes a white Text element.
It uses the MapLocation "name" property as text.
This text is only visible if the map zoom is above "textVisibleZoom".

For hundreds of dives, using the DropShadow effect for the text
makes it laggy. Instead, using a fake drop shadow (duplicate black
Text under the default text) makes it much better.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
8c7d1a1163 mapwidget.qml: add zoom-in and zoom-out buttons
The buttons are positioned bellow the "toggle map type" button
and increment / decrement the zoom by "zoomStep" (2 for now).

Also clamp the zoom-in level to "map.maximumZoomLevel".

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
f94aa61009 mapwidget.qml: ";" and variable declaration cleanup
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
38d9759198 mapwidget.qml: add double click on zoom
Double clicking a marker or the newly added MouseArea now performs
a +2 zoom-in over a period of 500ms and centers on that clicked
coordinate.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
f1020a02ce mapwidget.qml: store the selected dives count in "nSelectedDives"
Different actions might be performed depending on the count of selected
dives - e.g. deep zoom only for a single selected dive.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
c078e350e0 mapwidgethelper: emit a selectedDivesChanged() signal
The signal emits a QList<int> filled with dive idexes from the
main backend dive table.

The MapWidgetHelper QML instance handles that in onSelectedDivesChanged().
This will only be needed for the mobile version, as the desktop version
should connect it's own slot in MapWidget.cpp.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
5ea702199b maplocationmodel: make setSelectedUuid() accept "fromClick" flag
The idea of this flag is to be able to only to emit the
selectedLocationChanged() signal when the user clicked on the map
(fromClick == true).

MapWidgetHelper::selectedLocationChanged() listens for this signal
and only then it will select nearby dives based on a "small-cicle".

If "fromClick" is false, it's the backend or the dive list that
updated the selection and MapWidgetHelper::selectedLocationChanged()
should no be called.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
747f3d8cab mapwidget.qml: call calculateSmallCircleRadius() on zoom changes
Each time the zoom changes MapWidgetHelper::calculateSmallCircleRadius()
is called, and the "small circle" radius is stored in both C++ and QML.

On the C++ side this radius will be used to select multiple nearby
dives.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
66b2f0c88c mapwidget.qml: call "copy to clipboard" actions in the maphelper C++
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
621dd53a43 mapwidget.qml: open current location in Google Maps
openLocationInGoogleMaps() now can be used to open a URL in an
external browser, triggered by the context menu. Use the same
Google Maps URL formating as in main.qml showMap().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
4d0d0e102b mapwidgetcontextmenu: add the actionSelected() signal
The actionSelected() signal is now dispatched when the user selects
an action from the menu (see the "actions" object). Then the declaration
of the MapWidgetContextMenu object in mapwidget.qml can catch that
signal in the onActionSelected() slot and obtain the action via
switch() branching.

The actions enumeration is kept in QML for now, with the idea that
specific C++ methods from the mapwidgethelper class will be called
directly (if marked as Q_INVOCABLE), instead of a generic
onMapAction(action) C++ method in the helper. But if the actions
are possible from QML (like copying to clipboard) and are also
small and non-expensive, it might be better to keep them
in mapwidget.qml.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
413e471244 mapwidgetcontextmenu: rearrange some of the QML declarations
- move the readonly properties near the top of the root Item
- move the rest of the properties bellow the readonly properties
- make the ListView Timer as a child of the ListView
- slight rename of the timer ID

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
18d910f6a7 mapwidgetcontextmenu: add the ListView component
NOTES:
- the ListView object uses lsitItemDelagate to display all elements from
the model listModel
- onCountChanged() is used to adjust the x position based on the
maxItemWidth property which is calculated when the items are populated
with text
- onVisibleChanged() is used to deselect the last selected item by
calling listModel.selectedIdx = -1
- onOpacityChanged() i sued to make sure that the View is hidden if the
opacity becomes 0.0
- inside the View there is a MouseAre which obtains the selected item via
indexAt(x,y)
- there is a Timer with id listViewVisibleTimer, which is called each
time the user selects an item from the list and the timer performs a
"delayed hide"
- a couple of State and a Transition objects are used to preform smooth
fade-in / out animation when the ListView is hidden or becomes visible

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
95b0d43104 mapwidgetcontextmenu: add a listViewIsVisible integer property
This property would act like a state flag. If -1 (default) no QML State
animation will be pefromed, otherwise the ListView will either fade in
(1), or fade out (0) when the user clicks the context menu button
(Image) or selects an item from the list.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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